IF range contains a value then....

bob33

New Member
Joined
Oct 28, 2011
Messages
46
Sorry, I'm fried. Likely easy.

I need to look in a range of cells for the value 1 and if there, then 1, otherwise 0.
I thought this would work but doesn't:
=IF(C$48:C$51=1,1,0)

Thanks!
 

Some videos you may like

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

galt13

Board Regular
Joined
May 25, 2013
Messages
96
it would work if you entered it as an array formula. instead of pressing enter when you type the formula press cntrl+shift+enter
 

galt13

Board Regular
Joined
May 25, 2013
Messages
96

ADVERTISEMENT

or for fun you could use

=NOT(ISERROR(MATCH(1,C48:C51,0)))*1
 

Simon4s

Board Regular
Joined
Sep 22, 2014
Messages
143
Sorry, I'm fried. Likely easy.

I need to look in a range of cells for the value 1 and if there, then 1, otherwise 0.
I thought this would work but doesn't:
=IF(C$48:C$51=1,1,0)

Thanks!

You need to clarify what you want. Your formula works fine based on what you said you want to do...

If there is a "1" in any cell from C48:51.... then a 1 will be displayed in the cell you entered your "IF". Works perfectly.
 

bob33

New Member
Joined
Oct 28, 2011
Messages
46
I apologize for slow reply!
I ended up using: =IF(AND(C$54=0,C$55=1),1,IF(C49=0,0,1))
which obviously far from my original issue.
Simon4s: It still doesn't work. On my screen now are 2 1s in that range and the value for the formula is 0 (entered as an array formula).

Everyone else: I appreciate your suggestions; I learned some new approaches to the same issue, always a plus!
 

Watch MrExcel Video

Forum statistics

Threads
1,108,983
Messages
5,526,056
Members
409,682
Latest member
HisHailo

This Week's Hot Topics

Top