Sorting Values using... LOOKUP?

mescalante48

New Member
Joined
Sep 15, 2021
Messages
29
Office Version
  1. 2007
Platform
  1. Windows
Hello everyone, hope you can help.

what would be the formulas in C2 and D2

For C2: return A2 if B2<0 if not return 0
For D2: return A2 if B2>0 if not return 0

te result should look something like this, is LOOKUP the best option?

b022922c3c2de3605adfd6882fe089b4.png

Gyazo
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
I don't understand what you're trying to accomplish? Please provide more details.
 
Upvote 0
How about
+Fluff 1.xlsm
ABCD
1
21659016.75016590
316573.25-16.7516573.250
41658011.75016580
50000
Main
Cell Formulas
RangeFormula
C2:C5C2=A2*(B2<0)
D2:D5D2=A2*(B2>0)
 
Upvote 0
Solution
This part (B2<0)returns either True or False & when you do a mathematical operation on it the True becomes 1 & False 0
So if B2 is a positive number (B2<0)returns False, so A2 is multiplied by 0

HTH
 
Upvote 0
This part (B2<0)returns either True or False & when you do a mathematical operation on it the True becomes 1 & False 0
So if B2 is a positive number (B2<0)returns False, so A2 is multiplied by 0

HTH
Thank you so much for teaching.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,535
Messages
6,120,090
Members
448,944
Latest member
sharmarick

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top