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

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
Joined
Feb 8, 2007
Messages
243
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

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,961
Office Version
  1. 365
Platform
  1. Windows
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,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.
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