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.

[TABLE="width: 200"]
<TBODY>[TR]
[TD]YOY[/TD]
[TD]Grouping[/TD]
[/TR]
[TR]
[TD]0.0%[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]-25.7%[/TD]
[TD]-49 to -1[/TD]
[/TR]
[TR]
[TD]800%[/TD]
[TD]100+[/TD]
[/TR]
[TR]
[TD]-80.3%[/TD]
[TD]-100 to -50[/TD]
[/TR]
[TR]
[TD]52%[/TD]
[TD]50 to 100[/TD]
[/TR]
</TBODY>[/TABLE]
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
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,222,382
Messages
6,165,648
Members
451,983
Latest member
Raph24

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