View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Shams
 
Posts: n/a
Default Incorporating Vlookup in a IF Statement

Folks,
While you guys were sending me tips, I tried the following formula:

IF(ISNUMBER(VLOOKUP(A277,J:K,2,FALSE)),"To be allocated",0)

In other words, A277 is my tkt# in Table 1 and J:K is my array in Table 2.
So, now it is returning my text if it matches the lookup in J:K.

Am I technically correct in writing the formula as above or is it just a
quirk????

In the meantime I will also try the formula given to me by SteveG

"Shams" wrote:

Folks,
I have the following 2 tables:

Table 1:

Ticket # Gross Fare

2262945423 $628.24
2262945413 $1,029.16
2262945419 $1,029.16
2262945420 $1,029.16
2262945424 $1,029.16
2262945414 $2,815.11


Table 2:

Tckt# Gross Fare

2262945413 $1,029.16
2262945414 $2,815.11
2262945419 $1,029.16
2262945420 $1,029.16
2262945421 $2,892.40
2262945422 $2,892.40
2262945423 $628.24
2262945424 $1,029.16
2262945503 $908.84
2262945504 $2,887.05
2262945505 $2,588.91
2262945506 $1,029.16
2262945548 $2,588.91
2262945557 $55.10


Can I use a If statement to do a vlookup based on Tckt # in Table 1 and
search for it in Table 2 and if it finds the number in Table 2 then return
the following statement: " Not allocated - To be done".

I know that I can break out the function in two distinct processes but it
would be more efficient if I could consolidate them in one function. I will
appreciate any suggestions on this issue. Thank you.

Regards,
Shams.