validate list

david brown

New Member
Joined
Dec 15, 2002
Messages
19
i have a list of numbers, which should all be one of 12 possible "codes".
What is the easy way to check that the numbers are correct and highlight any that are incorrect entries.

I could use a large if function, =if(a1="123456", if(a1="7891011"........,"ok", "false")...... but this seams very clumbersome.
is there a way to use =IF( A1= any value of this array,"true","Fales"


any help apreciated.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Atholl

Active Member
Joined
May 19, 2002
Messages
434
Try: Data -> Validation

Then in 'Validation Criteria', select Allow list. In the source box, either refer to some cells containing your numbers or type in the list, separated with commas.

HTH
 

david brown

New Member
Joined
Dec 15, 2002
Messages
19
thanks, but the problem is i have already got a list of several thousand numbers( codes ) from another source and need to validate this list to identify any incorrect values.
 

NBVC

Well-known Member
Joined
Aug 31, 2005
Messages
5,828
You can put the list in a separate area and refer to it via a Match() formula


for example: =If(isnumber(match(A1,$X$1:$X$100,0)),"Match Found","No Matches") where X1:X100 contains the list to match up against

this could be copied down and also could be amended to use in a conditional format statement..... like so =Isnumber(Match(A1,$X$1:$X$100,0))
 

Forum statistics

Threads
1,171,281
Messages
5,874,824
Members
433,075
Latest member
DRubio

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