Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
pol pol is offline
external usenet poster
 
Posts: 129
Default To check two sheets in a single file in Vlookup()

The following is working that if the same item exist in G7 and in
item.xls(item!)
=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),0).

But I have to check two sheet Item! and Stock! in item.xls. If the G7
value may exist either in Item1 sheet or in stock! sheet. So please help me
again to incorparate this changes with the existing formula
=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),0).

=IF(COUNTIF([item.xls]stock!B:B,G7),VLOOKUP(G7,[item.xls]stock!B:L,11,0),0).




  #2   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default To check two sheets in a single file in Vlookup()

You could string it to check in sequence like this, indicatively:
=IF(COUNTIF(1),VLOOKUP(1),IF(COUNTIF(2),VLOOKUP(2) ,0),0)

A subtle point is the significance of the sequence. Since the IF evaluates
from left to right, if (1) is TRUE, (2) will never get evaluated. You should
place the more "reliable" reference sheet to be (1) within the expression, eg
if the reference sheet: item is better, place it in (1) to be checked ahead
of "stock"
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---
"pol" wrote:
The following is working that if the same item exist in G7 and in
item.xls(item!)
=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),0).

But I have to check two sheet Item! and Stock! in item.xls. If the G7
value may exist either in Item1 sheet or in stock! sheet. So please help me
again to incorparate this changes with the existing formula
=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),0).

=IF(COUNTIF([item.xls]stock!B:B,G7),VLOOKUP(G7,[item.xls]stock!B:L,11,0),0).


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,389
Default To check two sheets in a single file in Vlookup()

What happens if the item exists in both tables?

Maybe you want something like:
=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),IF(COUNTIF([item.xls]stock!B:B,G7),VLOOKUP(G7,[item.xls]stock!B:L,11,0),0))

Regards,
Fred

"pol" wrote in message
...
The following is working that if the same item exist in G7 and in
item.xls(item!)
=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),0).

But I have to check two sheet Item! and Stock! in item.xls. If the G7
value may exist either in Item1 sheet or in stock! sheet. So please help
me
again to incorparate this changes with the existing formula
=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),0).

=IF(COUNTIF([item.xls]stock!B:B,G7),VLOOKUP(G7,[item.xls]stock!B:L,11,0),0).





  #4   Report Post  
Posted to microsoft.public.excel.misc
pol pol is offline
external usenet poster
 
Posts: 129
Default To check two sheets in a single file in Vlookup()

Greate! Thanks a lot

"Fred Smith" wrote:

What happens if the item exists in both tables?

Maybe you want something like:
=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),IF(COUNTIF([item.xls]stock!B:B,G7),VLOOKUP(G7,[item.xls]stock!B:L,11,0),0))

Regards,
Fred

"pol" wrote in message
...
The following is working that if the same item exist in G7 and in
item.xls(item!)
=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),0).

But I have to check two sheet Item! and Stock! in item.xls. If the G7
value may exist either in Item1 sheet or in stock! sheet. So please help
me
again to incorparate this changes with the existing formula
=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),0).

=IF(COUNTIF([item.xls]stock!B:B,G7),VLOOKUP(G7,[item.xls]stock!B:L,11,0),0).






  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,389
Default To check two sheets in a single file in Vlookup()

You're welcome. Thanks for the feedback.

Regards,
Fred

"pol" wrote in message
...
Greate! Thanks a lot

"Fred Smith" wrote:

What happens if the item exists in both tables?

Maybe you want something like:
=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),IF(COUNTIF([item.xls]stock!B:B,G7),VLOOKUP(G7,[item.xls]stock!B:L,11,0),0))

Regards,
Fred

"pol" wrote in message
...
The following is working that if the same item exist in G7 and in
item.xls(item!)
=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),0).

But I have to check two sheet Item! and Stock! in item.xls. If the
G7
value may exist either in Item1 sheet or in stock! sheet. So please
help
me
again to incorparate this changes with the existing formula
=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),0).

=IF(COUNTIF([item.xls]stock!B:B,G7),VLOOKUP(G7,[item.xls]stock!B:L,11,0),0).







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
ExportAsFixedFormat for Multiple Sheets in a Single Excel File ivanL Excel Worksheet Functions 2 February 12th 08 07:42 PM
How to check duplications in a single column Burhan Uddin Excel Discussion (Misc queries) 2 June 6th 07 12:17 PM
How to check for duplications in a single column Burhan Uddin Excel Discussion (Misc queries) 0 June 6th 07 09:38 AM
Protecting single sheets mattgoof2005 Excel Discussion (Misc queries) 2 June 13th 06 01:42 AM
Save a single worksheet in Excel as a single file. Dakota New Users to Excel 4 February 22nd 06 04:46 PM


All times are GMT +1. The time now is 12:28 PM.

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

About Us

"It's about Microsoft Excel"