If Formula

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
2,040
Office Version
  1. 2019
Platform
  1. Windows
Peace,

what formula that checks cell F2 and cell G2 for 0/blank values.

If both the above cells are 0/blank then give output 0 otherwise give output 1.

Thanks.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
What type of value would be in the cells if they are not 0/blank ? Text or Number?
 
Upvote 0
This might be better:

=AND((OR(ISBLANK(F2),F2=0)),OR(ISBLANK(G2),G2=0))
 
Upvote 0
YES thanks..

Glad to help

Important to note that if the cells have negative numbers, and the sum of those numbers = 0, then you get a false when it should be true.
Example
F2=2
G2=-2
sum(F2:G2)=0, formula results in 0
 
Upvote 0
negative may not occur in such an instance. Is number and all positive. thanks again..
 
Upvote 0
Dear jommo1,

I needed to say the formula y've posted is running fine however it'd be great if it could output values in " 0 , 1 and 2 "

example "0"

F2 = 0 or blank
G2 = 0 or blank

hence H2 = 0

example "1"

F2 = 50 or any other value except for 0
G2 = 0 or any other value except for 50

hence H2 = 1

example "2"

F2 = 50 or same value as G2 except for 0
G2 = 50 or same value as F2 except for 0

hence H2 = 2

please let me know if further clarification is required. :)
 
Upvote 0

Forum statistics

Threads
1,213,524
Messages
6,114,117
Members
448,549
Latest member
brianhfield

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