Using an IF function across a range of values

london surveyor

New Member
Joined
Mar 16, 2006
Messages
8
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

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
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.
 
Upvote 0
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")
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,289
Members
449,077
Latest member
Rkmenon

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
Back
Top