#Value! error on if/or statement

PTori82

Board Regular
Joined
Dec 5, 2012
Messages
64
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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
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)
 
Upvote 0
Hi,

You can also do this:

=--OR(B4={"PF/C","SG/SF","PG/SF"})
 
Upvote 0
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?
 
Upvote 0
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:
Upvote 0
Now the Result ( 1 and 0 ) is Reversed:

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

Is that what you mean.
 
Upvote 0
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!
 
Upvote 0

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

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