# #Value! error on if/or statement

#### PTori82

##### Board Regular
I'm looking for cell R4 to enter a "1" if cell B4= either "PF/C", "SG/SF" or "PG/SF". Here is the formula I used. Keep getting the #Value ! error. I need this to be a 1 or 0 so that I can run this as part of solver. Thank you!

=IF(OR(B4="PF/C",B4="SG/SF",B4="PG/SF"),1*O4)

I then changed it to IFERROR(OR(B4="PF/C",B4="SG/SF",B4="PG/SF"),1*O4) to try to get rid of it but cell R4 now just says either true of false.

Last edited:

### Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Why do you multiply 1 * O4. If you have a text in cell O4, it will return you Error: "# VALUE!?

Try:

=IF(OR(B4="PF/C",B4="SG/SF",B4="PG/SF"),1,0)

Thank you!

Hi,

You can also do this:

=--OR(B4={"PF/C","SG/SF","PG/SF"})

That works, thanks!

I have to multiply the result by 0 so I can run it in solver. How do I get the input to read "0" if it is true?

If you're replying to me, my formula in Post # 4 Already converts TRUE to 1, and FALSE to 0

But, are you saying you want it reversed?

Edit: meaning, do you want it to convert TRUE to 0, and FALSE to 1 ?

Last edited:
Yes, even if it's true I need it to say 0

Now the Result ( 1 and 0 ) is Reversed:

=--NOT(OR(B4={"PF/C","SG/SF","PG/SF"}))

Is that what you mean.

If it is true or false, I need it say 0. Solver will put a "1" in the box by design once I run that. The 1 put in by solver shows me what I'm looking for. Sp for now, I need the cell to either show a 0, if true, or nothing at all. Thank you so much for your help so far!

Replies
7
Views
231
Replies
5
Views
243
Replies
2
Views
124
Replies
18
Views
668
Replies
15
Views
284

1,202,976
Messages
6,052,880
Members
444,606
Latest member
rwmhr

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