IF statements with negative values

ypatel1990

New Member
Joined
Aug 8, 2014
Messages
11
Hey everyone,

I currently have a column with a list of percentages of year over year change and am trying to create a column next to it to show different groupings that it would fall under for a pivot table. I keep getting the value false when running my if statements. I have an example of what I am trying to do in the Grouping column below. Not sure if the numbers being percentages is causing problems but I tried to copy and paste the column as values but all of the numbers changed.

YOYGrouping
0.0%0
-25.7%-49 to -1
800%100+
-80.3%-100 to -50
52%50 to 100

<TBODY>
</TBODY>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
How about?

=LOOKUP(A2,{-1,-0.5,0,0.1,0.5,1},{"-50 to -100","-1 to -49","0","1 to 50","50 to 100","100+"})

This actually works great. How exactly does the formula differentiate between the ranges like 0 and -1 to -49 when everything is just seperated with commas?
 
Upvote 0
The curly braces contain array constants. LOOKUP finds the largest item in the first array that is less than or equal to the lookup value and returns the item at the same position in the second array.
 
Upvote 0
The curly braces contain array constants. LOOKUP finds the largest item in the first array that is less than or equal to the lookup value and returns the item at the same position in the second array.

Thats makes much more sense now. This is so much simpler in comparison to a bunch of IF AND statements for all ranges.
 
Upvote 0

Forum statistics

Threads
1,215,440
Messages
6,124,882
Members
449,193
Latest member
PurplePlop

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