#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

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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