Comparing

  • Thread starter Thread starter Bill Hand
  • Start date Start date
B

Bill Hand

I have a column in my spreadsheet that lists New York county numbers 1
thru 62. I would like to create a loop that checks these numbers and
if it is a 1 put the actual county name in a different cell.

NY 12 YA Cortland NY 13045 <###>
NY 12 13 Marathon NY 13803 <###>
* where 12 is the county number.
(2000 more records like these)

So since these two records contain 12 as the county number I do
something like:
If <CountyNumber> = 1 then <Anycell> = "Albany"
If <countyNumber> = 2 then <Anycell> = "Allegany"
....

I hope I explained myself somewhat clearly.

Thanks.
 
Is the number the last thing? Hard to tell from the YA and 13 below?
if the number starts at space 4 allowing for 999 counties, this might work
=MID(C7,4,3)
=vlookup(mid(c7,4,3),sheet2!a2:a200,1)
where a lookup table is set up on sheet 2
a2 b2
1 myfirstcounty,ny 222
 
Back
Top