Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Combining "IF"statement with "Vlookup"

I have a data table in a worksheet that uses the vlookup to match a unique
value from a cell and populate various other cells with data retreived.
The problem is that the formula is active and any blank lookup value returns
the usual #NA throughout the data sheet. I thought I might be able to combine
an "IF" cell is not empty then Vlookup.
Can any body help with this ? or another alternative

Thanks in advance.

Malcolm McMaster
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Combining "IF"statement with "Vlookup"

Try:

=IF(A1="","",VLOOKUP(whatever you need to lookup))

Assuming A1 is the cell to recieve a value that will be looked up elsewhere.

"Malcolm McMaster" wrote:

I have a data table in a worksheet that uses the vlookup to match a unique
value from a cell and populate various other cells with data retreived.
The problem is that the formula is active and any blank lookup value returns
the usual #NA throughout the data sheet. I thought I might be able to combine
an "IF" cell is not empty then Vlookup.
Can any body help with this ? or another alternative

Thanks in advance.

Malcolm McMaster

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Combining "IF"statement with "Vlookup"

On Friday, April 11, 2008 7:15:00 PM UTC-4, mike wrote:
Try:

=IF(A1="","",VLOOKUP(whatever you need to lookup))

Assuming A1 is the cell to recieve a value that will be looked up elsewhere.

"Malcolm McMaster" wrote:

I have a data table in a worksheet that uses the vlookup to match a unique
value from a cell and populate various other cells with data retreived.
The problem is that the formula is active and any blank lookup value returns
the usual #NA throughout the data sheet. I thought I might be able to combine
an "IF" cell is not empty then Vlookup.
Can any body help with this ? or another alternative

Thanks in advance.

Malcolm McMaster


Thanks worked like a charm!
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Combining "IF"statement with "Vlookup"

Just use

=IF(ISNA(vlookup_formula),"",vlookup_formula)

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Malcolm McMaster" wrote in
message ...
I have a data table in a worksheet that uses the vlookup to match a unique
value from a cell and populate various other cells with data retreived.
The problem is that the formula is active and any blank lookup value
returns
the usual #NA throughout the data sheet. I thought I might be able to
combine
an "IF" cell is not empty then Vlookup.
Can any body help with this ? or another alternative

Thanks in advance.

Malcolm McMaster



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 492
Default Combining "IF"statement with "Vlookup"

Not entirely sure I understand.
If you mean the cell that contains the value the VLOOKUP is searching for is
blank, in this example D2, then
=IF(D2<"",VLOOKUP(D2,A1:B7,2,FALSE),"")
If you mean the cell in the data table the VLOOKUP finds is blank then,
=IF(ISNA(VLOOKUP(D2,A1:B8,2,FALSE)),"",VLOOKUP(D2, A1:B8,2,FALSE))
If your using 2007 I believe there is a function to do this easier, (I'm on
2003)
Regards,
Alan.
"Malcolm McMaster" wrote in
message ...
I have a data table in a worksheet that uses the vlookup to match a unique
value from a cell and populate various other cells with data retreived.
The problem is that the formula is active and any blank lookup value
returns
the usual #NA throughout the data sheet. I thought I might be able to
combine
an "IF" cell is not empty then Vlookup.
Can any body help with this ? or another alternative

Thanks in advance.

Malcolm McMaster




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Combining "IF"statement with "Vlookup"

In 2007 you could also use IFERROR(), which is what I think Alan is refering
to.

=IFERROR(VLOOKUP(),"")

Also, Alan is correct in that it depends on what it is that is left blank.
My original suggestion assumed that the entry cell is what is blank.

"Alan" wrote:

Not entirely sure I understand.
If you mean the cell that contains the value the VLOOKUP is searching for is
blank, in this example D2, then
=IF(D2<"",VLOOKUP(D2,A1:B7,2,FALSE),"")
If you mean the cell in the data table the VLOOKUP finds is blank then,
=IF(ISNA(VLOOKUP(D2,A1:B8,2,FALSE)),"",VLOOKUP(D2, A1:B8,2,FALSE))
If your using 2007 I believe there is a function to do this easier, (I'm on
2003)
Regards,
Alan.
"Malcolm McMaster" wrote in
message ...
I have a data table in a worksheet that uses the vlookup to match a unique
value from a cell and populate various other cells with data retreived.
The problem is that the formula is active and any blank lookup value
returns
the usual #NA throughout the data sheet. I thought I might be able to
combine
an "IF" cell is not empty then Vlookup.
Can any body help with this ? or another alternative

Thanks in advance.

Malcolm McMaster



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Combining "IF"statement with "Vlookup"

On Saturday, April 12, 2008 2:40:01 AM UTC+3, mike wrote:
In 2007 you could also use IFERROR(), which is what I think Alan is refering to.=IFERROR(VLOOKUP(),"")Also, Alan is correct in that it depends on what it is that is left blank. My original suggestion assumed that the entry cell is what is blank."Alan" wrote: Not entirely sure I understand. If you mean the cell that contains the value the VLOOKUP is searching for is blank, in this example D2, then =IF(D2<"",VLOOKUP(D2,A1:B7,2,FALSE),"") If you mean the cell in the data table the VLOOKUP finds is blank then, =IF(ISNA(VLOOKUP(D2,A1:B8,2,FALSE)),"",VLOOKUP(D2, A1:B8,2,FALSE)) If your using 2007 I believe there is a function to do this easier, (I'm on 2003) Regards, Alan. "Malcolm McMaster" wrote in message ... I have a data table in a worksheet that uses the vlookup to match a unique value from a cell and populate various other cells with data retreived. The problem is that the formula is active and any blank lookup value returns the usual #NA throughout the data sheet. I thought I might be able to combine an "IF" cell is not empty then Vlookup. Can any body help with this ? or another alternative Thanks in advance. Malcolm McMaster


Sir's, I have the same issue, but something more complicated for me. i have two sheets in a work book,
sheet1- Item, Brand, price.
Sheet2 -Item, Brand, empty price column.
How to run vlookup to match the 2 entities in sheet 2 and match with sheet 1 and pull the exact price? Please help me.
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 829
Default Combining "IF"statement with "Vlookup"

"Nidhi" wrote:
i have two sheets in a work book,
sheet1- Item, Brand, price.
Sheet2 -Item, Brand, empty price column.
How to run vlookup to match the 2 entities in sheet 2
and match with sheet 1 and pull the exact price?


I don't see how this is related to the previous discussion or the quoted
response. And in any case, it would be better to submit a new question
instead of "responding" to a 5-year-old discussion.

Assuming that Item is in A2:A1000, Brand is in B2:B1000, and Price is in
C2:C1000, you might use the following array-entered formula (press
ctrl+shift+Enter instead of just Enter):

=VLOOKUP(A2&B2, Sheet1!$A$2:$A$1000&Sheet1!$C$2:$C$1000, 3, FALSE)

But I do not recommend that because it is inefficient and because
array-entered formulas are prone to human error: pressing just Enter by
mistake sometimes __seems__ to work (not really!) instead of producing an
Excel error.

It would be better to add a 4th column in Sheet1 (D2:D1000) with formulas of
the form =A2&B2.

Then use the following normally-entered formula (just press Enter as usual):

=INDEX(Sheet1!$C$2:$C$1000, MATCH(A2&B2, Sheet1!$D$2:$D$1000, 0))

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 829
Default Combining "IF"statement with "Vlookup"

Errata.... I wrote:
Assuming that Item is in A2:A1000, Brand is in B2:B1000, and Price is
in C2:C1000, you might use the following array-entered formula (press
ctrl+shift+Enter instead of just Enter):
=VLOOKUP(A2&B2, Sheet1!$A$2:$A$1000&Sheet1!$C$2:$C$1000, 3, FALSE)


My bad! Use the following array-entered formula instead (press
ctrl+shift+Enter instead of Enter):

=INDEX(Sheet1!$C$2:$C$1000, MATCH(A2&B2,
Sheet1!$A$2:$A$1000&Sheet1!$B$2:$B$1000, 0))

But again: that is not really recommended for the reasons noted previously.

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Combining "IF"statement with "Vlookup"

hai




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Combining formulas, "and" & "or" to verify content of multiple cel Shu of AZ Excel Discussion (Misc queries) 15 October 15th 06 11:22 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM


All times are GMT +1. The time now is 04:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"