if & or functions???

Elise Nerlove

Board Regular
Joined
Dec 17, 2009
Messages
94
Hi,

I need help with an equation:

If column A = nothing AND column B = nothing, then do nothing. But if a value appears in either column a or b then do the equation: b-a=c

im thinking the equation is: =if(a="",andif(b="","",b-a))

but this is outputting "FALSE" for all rows....any ideas?

Thanks so much for the help!!! greatly appreciated!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Does this work:

=IF(A1="","",IF(B1="","",B1-A1))

or this:

=IF(AND(A1="",B1=""),"",B1-A1)

depending if i misunderstood you
 
Last edited:
Upvote 0
Thanks so much!!

prabby, that equation didnt quite work, but ljungren13 your equation worked!!

Problem solved, thanks!

Elise
 
Upvote 0
Did you want to check if one of A1 or B1 is blank or both blank. In case you wanted to display "" if any of these are blank, then use this -

=IF(OR(ISBLANK(A1),ISBLANK(B1)),"",B1-A1)
 
Upvote 0
Seems to me that she was looking for an or situation. The Count works great, but maybe like this for OR?

=IF(COUNT(A1:B1)>0,B1-A1,"")

This satisfies the OR in her needs. Seems like if both are BLANK then do nothing and if EITHER has a value then b-a.

cheers,

omicronkappa278
louisiana
 
Upvote 0
Yes, specifically any number not equal to 0 will equate to TRUE.
 
Upvote 0

Forum statistics

Threads
1,213,484
Messages
6,113,927
Members
448,533
Latest member
thietbibeboiwasaco

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