a simple if function ?

iffi

Board Regular
Joined
Jun 5, 2011
Messages
59
Office Version
  1. 2019
Platform
  1. Windows
confused, tried myself but faild
how do i combine 2 or 3 conditions to be met together at the same time.
example:
if A1 and B1 are not blank and A1 and B1 both are greater than 0 then do this A1 - B1

Thanks for ur co-operation as usual.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Maybe like this:

=IF(AND(A1>0,B1>0),A1-B1,FALSE)

What would you want the result to be if there was a number in a1 or b1 that was less than zero (not meeting your criteria). Or if both are blank?
 
Upvote 0
Thanks ur quick and kind reply, i got my problem solved by ur given formulae.
u misunderstood some words in my post. i said above, if both are not blank that means they must contain some numbers and also they must be greater than zero, in this way, i will get my desired result. Thanks again
 
Upvote 0
Here is one I made, though I also may have misread the question.
It just checks for blank cells and checks if the value is >0.


Code:
=IF(AND(A1<>"",B1>0),IF(AND(B1<>"",B1>0),A1-B1,""),"")

cheers
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,774
Members
452,942
Latest member
VijayNewtoExcel

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