IF range contains a value then....

bob33

Board Regular
Joined
Oct 28, 2011
Messages
51
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!
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

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
152
Office Version
  1. 2016
  2. 2013
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

Board Regular
Joined
Oct 28, 2011
Messages
51
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!
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,015
Messages
5,834,939
Members
430,327
Latest member
Mr_Himalayan778

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