# Using an IF function across a range of values

#### london surveyor

##### New Member
I would like to be able to identify if a user entered value is equal to a series of calculated figures in my spreadsheet.

I intend to use the IF function but have too many values to state lots and lots of OR options (eg input value = A1, input value =A2, Input value =A3 etc). Is there a neat way of doing it?

The ideal would be to say something along the lines of IF(input value = any of the values in the series (A1:A50), “true”, “false”).

Regards

### Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

#### Thorin

##### Board Regular
You could try an array formula :-

Code:
``=IF(OR(D1=A1:A50),"True","False")``

Copy and paste the formula above, then edit it and press Ctrl+Shift+Enter to put the {} around it.

See if this works for you.

#### Scott Huish

##### MrExcel MVP
If you just want to say TRUE/FALSE

=COUNTIF(A1:A50,D50)>0

or in an IF:

=IF(COUNTIF(A1:A50,D50),"True Value","False Value")

Replies
4
Views
780
Replies
5
Views
431
Replies
3
Views
2K
Replies
1
Views
351
Replies
2
Views
934

1,191,499
Messages
5,986,916
Members
440,064
Latest member
Pluong91

### 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