Checking to see if value in cell equals one of many numbers

brjv42

New Member
Joined
Nov 7, 2005
Messages
11
I am working on a mailing list and I was wondering if there is a line of code that will look at a cell, see if it has one of many zip codes in it, and then spit out the county.

Example:
I have a county that has 5 zip codes in it: 47558, 47501, 47519, 47568 & 47562.

They are all speratically placed in a column throughout the spreadsheet.

I need a piece of code that will look through that column, see if the zip codes match, and then put the county "DAVIESS" in the next column.

I know that this can be done with an IF statement, but the problem is that I have six different counties that I am looking for and each have at least 5 zip codes within the county.

If anyone can help, I would greatly appreciate it.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Make a list of the zip codes with the county in the next column, say on Sheet2 A1:B30. Then you can use a formula like this:

=VLOOKUP(B2,Sheet2!A1:B30,2,FALSE)

where B2 contains the zip code whose county you want.
 
Upvote 0

Forum statistics

Threads
1,214,805
Messages
6,121,664
Members
449,045
Latest member
Marcus05

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