IF 4 Cases

Rob #4

Board Regular
Joined
Jun 19, 2003
Messages
194
Can someone help me merge these four formulas:

=IF(A3="E",C3*(1+'L&E Rates'!B25),"")

=IF(A3="L",C3*(1+'L&E Rates'!B24),"")

=IF(A3="M",C3*(1+'L&E Rates'!B26),"")

=IF(A3="S",C3*(1+'L&E Rates'!B27),"")

Basically If Cell A3 equals one of those letters I want to multiply C3 by a certain cell on another sheet. Can anyone help me?
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Try

=INDEX('L&E Rates'!B24:B27,MATCH(A3,{"L","E","M","S"},0))*C3


It will error if A3 doesn't equal any of the 4 choices.
 
Last edited:
Upvote 0
Try
Code:
=IF(A3="E",C3*(1+'L&E Rates'!B25),IF(A3="L",C3*(1+'L&E Rates'!B24),IF(A3="M",C3*(1+'L&E Rates'!B26),IF(A3="S",C3*(1+'L&E Rates'!B27),""))))

This will not error but only return empty strings when they do not equal to any of the 4 choices.
 
Upvote 0
At a very basic level, you can go for nested IFs, like this.

Code:
=if(A3="E",C3*(1+'L&E Rates'!B25),if(A3="L",C3*(1+'L&E Rates'!B24),if(A3="M",C3*(1+'L&E Rates'!B26),if(A3="S",C3*(1+'L&E Rates'!B27),""))))
Not tested, but I think this should work.

There are more elegant solutions though.
 
Upvote 0
Can someone help me merge these four formulas:

=IF(A3="E",C3*(1+'L&E Rates'!B25),"")

=IF(A3="L",C3*(1+'L&E Rates'!B24),"")

=IF(A3="M",C3*(1+'L&E Rates'!B26),"")

=IF(A3="S",C3*(1+'L&E Rates'!B27),"")

Basically If Cell A3 equals one of those letters I want to multiply C3 by a certain cell on another sheet. Can anyone help me?





If you can Index the rates with the letters
as in put "S" in 'L&E Rates'!A27
then you can use a lookup

=If(iserr(Vlookup(A3,'L&E Rates'!$A$1:$B$27,2,FALSE)),"",C3*1+Vlookup(A3,'L&E Rates'!$A$1:$B$27,2,FALSE)

also means if you get more rates you don't have to change your formula
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,470
Members
452,915
Latest member
hannnahheileen

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