IF Statement with multiple conditions

janema

Board Regular
Joined
Nov 28, 2022
Messages
132
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2011
  5. 2010
Platform
  1. Windows
  2. Mobile
I keep getting stuck when it comes to IF statements with multiple conditions. I am trying to get this formula to perform an calculation based on the cell that is not empty (checking two cell first). Is that possible? Thank you so much in advance for your help!

Here is what I am trying to write separated out:

IF column R2 shows "International" then return the value "int'l"
IF there is a value in column BZ, then divide column BZ by BU
If there is a value in column CC, then divide column CC by BU
If there is a value in column CE, then divide column CE by BU
If there is a value in both column CC and CE, then divide CC by BU
Otherwise, just divide column G by BU

I tried writing it this way, but it indicates

=IF(R2="International","int'l",IF(BZ2,<>"",BZ2/BU2),IF(CC2,<>"",CC2/BU2),IF(CE2,<>"",CE2/BU2),IF(AND(CC2,<>''",CE2,<>"",CC2/BU2),G2/BU2)))

I get this error when I try this formula:

1723678354699.png

1723678402479.png
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Your data posted as an image is not particularly helpful, but I think this will avoid the problem you are having with the formula:
Excel Formula:
=IF(R2="International","int'l",IF(BZ2<>"",BZ2/BU2,IF(CC2<>"",CC2/BU2,IF(CE2<>"",CE2/BU2,IF(AND(CC2<>"",CE2<>""),CC2/BU2,G2/BU2)))))
 
Upvote 0
Solution
Also it is never going to get to this:
Excel Formula:
IF(AND(CC2<>"",CE2<>"")

Since it will be caught by
Excel Formula:
IF(CC2<>""
before it gets there.
 
Upvote 1
Also it is never going to get to this:
Excel Formula:
IF(AND(CC2<>"",CE2<>"")

Since it will be caught by
Excel Formula:
IF(CC2<>""
before it gets there.

The formula should still work though, don't you think?
 
Upvote 0
It will but you will get the same result without the additional if statement:
Excel Formula:
=IF(R2="International","int'l",IF(BZ2<>"",BZ2/BU2,IF(CC2<>"",CC2/BU2,IF(CE2<>"",CE2/BU2,G2/BU2))))
 
Upvote 1

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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