ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   When "IF" is not enough... (https://www.excelbanter.com/excel-worksheet-functions/213682-when-if-not-enough.html)

duke_h

When "IF" is not enough...
 
I'm working on a spreadsheet with postal adresses. All the adresses are
located geographicaly in a non-urban area and the postal code depends on the
name of the village of the recipient. I have almost 500 people (=adresses) in
about 15 villages. These 15 villages share 8 different postal codes. I would
like to use a function that "sees" the name of the village in the "Village"
column and produces the right postal code. The IF function cant be used for
more than 7 "ifs". What could I do?

Niek Otten

When "IF" is not enough...
 
Use VLOOKUP.
See this tutorial:

http://www.contextures.com/xlFunctions02.html

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"duke_h" wrote in message
...
I'm working on a spreadsheet with postal adresses. All the adresses are
located geographicaly in a non-urban area and the postal code depends on
the
name of the village of the recipient. I have almost 500 people (=adresses)
in
about 15 villages. These 15 villages share 8 different postal codes. I
would
like to use a function that "sees" the name of the village in the
"Village"
column and produces the right postal code. The IF function cant be used
for
more than 7 "ifs". What could I do?



Max

When "IF" is not enough...
 
Assume this data:
These 15 villages share 8 different postal codes

is listed in Sheet2, cols A and B,
villages in col A, corresponding postal codes in col B

In Sheet1,
Assume the village data is in D2 down
Put in E2: =IF(D2="","",VLOOKUP(D2,Sheet2!A:B,2,0))
Copy down
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:21,000 Files:365 Subscribers:65
xdemechanik
---
"duke_h" wrote:
I'm working on a spreadsheet with postal adresses. All the adresses are
located geographicaly in a non-urban area and the postal code depends on the
name of the village of the recipient. I have almost 500 people (=adresses) in
about 15 villages. These 15 villages share 8 different postal codes. I would
like to use a function that "sees" the name of the village in the "Village"
column and produces the right postal code. The IF function cant be used for
more than 7 "ifs". What could I do?


Keith Faulconer

When "IF" is not enough...
 
Duke:

If each village will have it's own postal code, then set up a list that
would liik like this:

Village Postal Code
Village 1 50000
Village 2 50001
etc

When you get all of the villages entered, highlight the list and name it
something like "Codes." Then, do a vlookup function. If the village is
listed in cell b1, then your formula would be

=vlookup(b1,Codes,2,0)

Hope it helps.


"duke_h" wrote in message
...
I'm working on a spreadsheet with postal adresses. All the adresses are
located geographicaly in a non-urban area and the postal code depends on
the
name of the village of the recipient. I have almost 500 people (=adresses)
in
about 15 villages. These 15 villages share 8 different postal codes. I
would
like to use a function that "sees" the name of the village in the
"Village"
column and produces the right postal code. The IF function cant be used
for
more than 7 "ifs". What could I do?




All times are GMT +1. The time now is 05:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com