Thread: function
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Chey Chey is offline
external usenet poster
 
Posts: 52
Default function

=IF(ISBLANK(D3),"",VLOOKUP(D3,[ID]Sheet1!$A$2:$B$600,2,FALSE))
This is what I end up with but then it says NA

D3 is the City on My primary sheet and Sheet1!$A$2:$B$600 is the range of my
codes on my other sheet.
Is this right?

"Storm" wrote:

try a vlookup function.

let's say tab (worksheet) 2 that has the City ID code is named "ID". Then
let's say you have 16 Cities on your list which is entered on A1:A16 and then
the corresponding code is on B1:B16.

On your first tab (worksheet) where you have the complete mailing address,
let's say your city is on cell G1 and you want the ID code to appear on H1
based on G1's entry. Type this formula on H1:

=if(isblank(G1),"",vlookup(G1,ID!$A$1:$B$16,2,FALS E))

that should work!

"Chey" wrote:

I have two tabs I have one tab that has information Like mailing address city
state and some more. I have another tab that has citys with a id code. I
want to do a function that if City on tab 1 matches city on tab 2 then that
code.
So if I have Address Nikiski AK 99999
THen the Code for Nikiski on tab 2 would appear.
Thanks
Cheyenne