# use of the OR() function in combination with the IF() function

#### cthompson

##### Board Regular
Hi All,

I would have thought this was an easy thing to figure out, but I am stuck getting the OR() function to work correctly in combination with the IF() function.

In this case if cell d126 is either 310 or 319 return 1 otherwise 0. When i try it individually when cell d126 meets the criteria it works and returns 1, but when I use the OR() function it returns 0?? What am i doing wrong?

=IF((D126=310) *OR(D126=319),1,0)

### Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Code:
``=IF(OR((D126=310),(D126=319)),1,0)``

place the OR before the 2 sets of logic,

perfect, thanks again. Now it seems so simple.

Replies
5
Views
843
Replies
7
Views
391
Replies
11
Views
998
Replies
3
Views
152
Replies
7
Views
1K

1,196,346
Messages
6,014,731
Members
441,843
Latest member
benji 71

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