# IF range contains a value then....

#### bob33

##### Board Regular
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
it would work if you entered it as an array formula. instead of pressing enter when you type the formula press cntrl+shift+enter

#### Brian from Maui

##### MrExcel MVP
Have you tried using COUNTIF?

=IF(COUNTIF(C48:C51,1)=1,1,0)

#### galt13

##### Board Regular
You could do this.

=IF(ISERROR(MATCH(1,C48:C51,0)),0,1)

#### galt13

##### Board Regular

or for fun you could use

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

#### Simon4s

##### Board Regular
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
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!

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.

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.

### Which adblocker are you using?

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

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