IF, OR, AND combo and the return of the second condition as a negative number.

aiki100

Board Regular
Joined
Aug 16, 2016
Messages
102
Hello - and thanks for the help!

Here is what I have:


=IF(OR(AND(C6>C5,O5="L"), AND(C6>C5,O5="S")), E6-C5, "www")



This formula DOES return a value for the first condition, but will not return anything other than what appears (to me) to be the first condition, for what *should* be a return of the the second condition...

Just as a test, I asked it to return WWW (as in the above), simply to see if I could get the second condition to evaulate to anything - and it does nothing - I only get the return of the first condition.



In truth, what I need is to get the negative version of the first condition that currently IS evaulating and returning. Something like (which does not work, btw) this below:


=IF(OR(AND(C6>C5, O5="L"), AND(C6>C5, O5="S")) ,E6-C5, (E6-C5)*-1)



So, in other words: do everything as before, but if O5 is an "S", do the same math, but make it negative.

Anyway, I suspect (know...lol) there is something fundamental I am missing here -no doubt!


Thanks so much to you all for any help or pointers you can assist with. It is much appreciated!
 
Last edited:

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Re: Help please with an IF, OR, AND combo and the return of the second condition as a negative number.

Hi,

If I understand correctly, try this:


Book1
ACEO
12
55S
663
Sheet12
Cell Formulas
RangeFormula
A1=IF(C6>C5,IF(O5="L",E6-C5,IF(O5="S",(E6-C5)*-1,"")),"")



Book1
ACEO
1-2
55L
663
Sheet12
Cell Formulas
RangeFormula
A1=IF(C6>C5,IF(O5="L",E6-C5,IF(O5="S",(E6-C5)*-1,"")),"")
 
Upvote 0
Re: Help please with an IF, OR, AND combo and the return of the second condition as a negative number.

Well, let me just thank you so much! That indeed did the trick, and I am so grateful for the help. I see where I went wrong, and will hopefully incorporate the knowledge going forward...lol...!

Thanks again - I wish you a fine weekend!
 
Upvote 0
Re: Help please with an IF, OR, AND combo and the return of the second condition as a negative number.

You're welcome, glad it was what you needed. Have a Great Weekend yourself.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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