# using the OR() function in combination with an IF() fuction

#### cthompson

##### Board Regular
Hi all

I have a very simple if() or() function combination and can not get it to work.

=IF((F5=3),I9)*OR(IF((G5=4),\$I\$9))

In this example if F5 =3 AND G5 =4 then I get the results of I9. But if F5 OR G5 are 0 i don't get any results even when a one cell meets the condition. I have tried a number of variations of the formula by where parentheses are located etc. but without success.

Any suggestions.
Thanks again
Chris

### 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.
Please explain in words what you want a working formula to do.

The condition for AND is below, but what happens when this condition is false?
=IF(AND(F5=3,G5=4),I9,...)

If you want the value of I9 when F5=3 or G5=4, you can use either of these 2 formulas:

1) =IF(OR(F5=3,G5=4),\$I\$9,"")
2) =IF((F5=3)+(G5=4),\$I\$9,"")

If you want the value of I9 when F5=3 and G5=4, you can use any of these 3 formulas:

1) =IF(AND(F5=3,G5=4),\$I\$9,"")
2) =IF((F5=3)*(G5=4),\$I\$9,"")
3) =IF(F5=3,IF(G5=4,\$I\$9,""))

All of these formulas will show as blank, symbolized by the quotes, if the statement is false.

Last edited:
sorry for the confusion

But I think you just showed me the correct syntax

What I am trying to do if either cell f5 or g5 equal 3 or 4 respectively then give the results of I9 otherwise 0. If I string all of the conditions for the OR(F5=3,G5=4) statement it works thank you so much.
Chris

Replies
1
Views
117
Replies
13
Views
432
Replies
1
Views
164
Replies
8
Views
419
Replies
14
Views
631

1,202,902
Messages
6,052,451
Members
444,582
Latest member
Scramble

### 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.

### Which adblocker are you using?

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

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