Formula Help

iimmie

New Member
Joined
Nov 13, 2011
Messages
24
Hi,
I am trying to figure out how to write the following:
if cell a1 or cell b1 has a number greater then zero in it, enter a #1 in cell c1

I appreciate the help once again
Thank you
 

Some videos you may like

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
Hi,
I am trying to figure out how to write the following:
if cell a1 or cell b1 has a number greater then zero in it, enter a #1 in cell c1

I appreciate the help once again
Thank you

Something like...

=IF(MIN(A1:B1)>0,1,"")

=(MIN(A1:B1)>0)+0
 

iimmie

New Member
Joined
Nov 13, 2011
Messages
24
Actually It didn't work, thank you for trying
Anyone else?
 
Last edited:

taurean

Well-known Member
Joined
Jun 17, 2011
Messages
2,179
Office Version
  1. 365
  2. 2016
Platform
  1. Windows

ADVERTISEMENT

Something like...

=IF(MIN(A1:B1)>0,1,"")

=(MIN(A1:B1)>0)+0
If the OP says: any one of the cells is greater than 0 then it should return 1 so should the formula not be:
=IF(MAX(A1:B1)>0,1,"")
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
If the OP says: any one of the cells is greater than 0 then it should return 1 so should the formula not be:
=IF(MAX(A1:B1)>0,1,"")

Right. Post #4 provides alternatives. Re-capping for iimmie:

=IF(MAX(A1:B1)>0,1,0)

=(MAX(A1:B1)>0)+0

=IF(OR(A1>0,B1>0),1,0)

=OR(A1>0,B1>0)+0

In case A1 and/or B1 might house text values

=IF(OR(N(A1)>0,N(B1)>0),1,0)

The first two would be good enough though.
 

iimmie

New Member
Joined
Nov 13, 2011
Messages
24
Thank you to everyone, you all rock!


Right. Post #4 provides alternatives. Re-capping for iimmie:

=IF(MAX(A1:B1)>0,1,0)

=(MAX(A1:B1)>0)+0

=IF(OR(A1>0,B1>0),1,0)

=OR(A1>0,B1>0)+0

In case A1 and/or B1 might house text values

=IF(OR(N(A1)>0,N(B1)>0),1,0)

The first two would be good enough though.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,224
Messages
5,594,915
Members
413,952
Latest member
JGer

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
Top