Multiple IF statements

Wally-sns

New Member
If i want to have multiple IF statements, how would i write the formula?

In other words, here is the following:

IF the Sales total is LESS THAN 100,000...then multiple Sales by 5%
IF the Sales total is BETWEEN 101,000 and 500,000,..then multiple Sales by 6%
IF the Sales total is GREATER THAN 101,000 and 500,000,..then multiple Sales by 7%

Help is much appreciated !

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
=INDEX({0.5,0.6,0.7},MATCH(A1-0.0001,{-1,100000,500000}))

I'm not familiar with the INDEX equation...can you give me a quick tutorial ?

What does the " A1-0.0001 " actually mean and what is it doing ?

I know that sometimes the help files can be hard to understand. What part of what's in the Excel help files was unclear?

It seems to work great....thanks very very much Greg !

I'm just not understanding what the "A1-0.0001" actually does and why it is there ?

Quite welcome. The A1-0.0001 is because otherwise MATCH is going to return the next item in line at the breakpoints. Subtracting a teeny amount makes it so that MATCH will return the "lower" value when A1 is at the breakpoint because the subtraction scoots it just a smidgeon under the threadhold. You could also just adjust the args inside the array so then the formula would read:

=INDEX({0.5,0.6,0.7},MATCH(A1,{0,100000.001,500000.001}))

It's just aesthetics -- which looks prettier. (Some of puritans might say that it's not just aesthetics because the first formula has that subtraction which is one extra operation so there is a performance hit. But the performance hit is akin to the impact of hitting a grasshopper's impact on you gas mileage -- negligable.)

Beautiful....but now how does it know about the greater than , less than, etc....just by only entering the values of 100, 500, etc. ?

Did you look over the help files' info on MATCH()? That's what's providing the 2nd argument into the INDEX() function. You might step through the formula using the formula auditing tool to get a better understanding of it. (Menu option Tools | Formula Auditing | Evaluate Formula)

Replies
3
Views
97
Replies
6
Views
379
Replies
6
Views
477
Replies
9
Views
160
Replies
0
Views
83

1,218,899
Messages
6,145,094
Members
450,590
Latest member
Naneng

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?

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

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