Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JR
 
Posts: n/a
Default vlookup help with two of the same lookups

Hi,

I need a little help. Below is a report that I dump in Excel. You will
note that both classifications have an €˜other option. How do I write a
formula that will skip classification if I want the total number of File
Breakdown €˜other and vise versa.

I have been using a vlookup.

Thanks


Classification Breakdown
Product Information 89
Issues 69
Return Information 38
Other 30
Order Status 24
Shipping Information 9
Website 2
Payment/Billing 2
File Breakdown
Deleted 220
Vendors 4
Mailing Responses 3
Other 1
Spam 1
Wholesale 1


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK
 
Posts: n/a
Default vlookup help with two of the same lookups

Assume your example data is in columns A and B exactly as posted, so
you have a heading in A1 and an upper table in A2 to B9, then another
heading in A10 and lower table in A11 to B16. You can define these as
named ranges - Upper = $A$2:$B$9 and Lower = $A$11:$B$16.

Elsewhere on your sheet you use a cell to specify the category you are
interested in (say, cell E1), another cell to specify whether Upper or
Lower (F1 - "U" or "L" specifies), then in cell G1 enter this formula:

=IF(F1="U", VLOOKUP(E1,Upper,2,0),IF(F1="L",VLOOKUP(E1,Lower,2 ,0),"")

So, if you enter "Other" in E1 and "L" in F1, you will get 1 in G1.
Change F1 to "U" and you get 30. If F1 contains anything other than U
or L then G1 displays blank. If the entry in E1 does not match you will
get #N/A.

Hope this helps.

Pete

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default vlookup help with two of the same lookups

Pete_UK wrote...
....
Elsewhere on your sheet you use a cell to specify the category you are
interested in (say, cell E1), another cell to specify whether Upper or
Lower (F1 - "U" or "L" specifies), then in cell G1 enter this formula:

=IF(F1="U", VLOOKUP(E1,Upper,2,0),IF(F1="L",VLOOKUP(E1,Lower,2 ,0),"")

....

Your formula's missing a right parenthesis at the end.

This could be simplified to

=VLOOKUP(E1,IF(F1="U",Upper,IF(F1="L",Lower,LEFT(E 1,{1024,0}))),2,0)

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK
 
Posts: n/a
Default vlookup help with two of the same lookups

Thanks for the correction, Harlan.

JR, the formula should be:

=IF(F1="U", VLOOKUP(E1,Upper,2,0),IF(F1="L",VLOOKUP(E1,Lower,2 ,0),""))

Pete

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JR
 
Posts: n/a
Default vlookup help with two of the same lookups

They are not two columns but only one. I broke it out for clarity, my bad.
Try this:

Classification Breakdown
Product Information 89
Issues 69
Return Information 38
Other 30
Order Status 24
Shipping Information 9
Website 2
Payment/Billing 2
File Breakdown
Deleted 220
Vendors 4
Mailing Responses 3
Other 1
Spam 1
Wholesale 1


"Pete_UK" wrote:

Assume your example data is in columns A and B exactly as posted, so
you have a heading in A1 and an upper table in A2 to B9, then another
heading in A10 and lower table in A11 to B16. You can define these as
named ranges - Upper = $A$2:$B$9 and Lower = $A$11:$B$16.

Elsewhere on your sheet you use a cell to specify the category you are
interested in (say, cell E1), another cell to specify whether Upper or
Lower (F1 - "U" or "L" specifies), then in cell G1 enter this formula:

=IF(F1="U", VLOOKUP(E1,Upper,2,0),IF(F1="L",VLOOKUP(E1,Lower,2 ,0),"")

So, if you enter "Other" in E1 and "L" in F1, you will get 1 in G1.
Change F1 to "U" and you get 30. If F1 contains anything other than U
or L then G1 displays blank. If the entry in E1 does not match you will
get #N/A.

Hope this helps.

Pete




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JR
 
Posts: n/a
Default vlookup help with two of the same lookups

I posted more info

"Harlan Grove" wrote:

Pete_UK wrote...
....
Elsewhere on your sheet you use a cell to specify the category you are
interested in (say, cell E1), another cell to specify whether Upper or
Lower (F1 - "U" or "L" specifies), then in cell G1 enter this formula:

=IF(F1="U", VLOOKUP(E1,Upper,2,0),IF(F1="L",VLOOKUP(E1,Lower,2 ,0),"")

....

Your formula's missing a right parenthesis at the end.

This could be simplified to

=VLOOKUP(E1,IF(F1="U",Upper,IF(F1="L",Lower,LEFT(E 1,{1024,0}))),2,0)


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JR
 
Posts: n/a
Default vlookup help with two of the same lookups

Also, the exact cell position of the 'other will change' daily depending on
which dispositions are used.

"Pete_UK" wrote:

Assume your example data is in columns A and B exactly as posted, so
you have a heading in A1 and an upper table in A2 to B9, then another
heading in A10 and lower table in A11 to B16. You can define these as
named ranges - Upper = $A$2:$B$9 and Lower = $A$11:$B$16.

Elsewhere on your sheet you use a cell to specify the category you are
interested in (say, cell E1), another cell to specify whether Upper or
Lower (F1 - "U" or "L" specifies), then in cell G1 enter this formula:

=IF(F1="U", VLOOKUP(E1,Upper,2,0),IF(F1="L",VLOOKUP(E1,Lower,2 ,0),"")

So, if you enter "Other" in E1 and "L" in F1, you will get 1 in G1.
Change F1 to "U" and you get 30. If F1 contains anything other than U
or L then G1 displays blank. If the entry in E1 does not match you will
get #N/A.

Hope this helps.

Pete


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK
 
Posts: n/a
Default vlookup help with two of the same lookups

I suggest that you do break it into two columns, then. You can do this
using Data | Text-to -Columns, using a single space as delimiter. It
doesn't matter where the "Other" rows are located within the tables,
but you must ensure that the named ranges Upper and Lower are adjusted
if the data occupies different areas.

Hope this helps again.

Pete

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
Using single cell reference as table array argument in Vlookup CornNiblet Excel Worksheet Functions 3 September 22nd 05 09:15 AM
VLOOKUP Limitations chris_manning Excel Worksheet Functions 2 August 9th 05 06:23 PM
Have Vlookup return a Value of 0 instead of #N/A Mr Mike Excel Worksheet Functions 4 May 25th 05 04:51 PM
vlookup data hidden within worksheet Excel Worksheet Functions 0 January 26th 05 12:09 PM
Vlookup info being used without vlookup table attached? Excel Worksheet Functions 0 January 25th 05 10:43 AM


All times are GMT +1. The time now is 01:26 AM.

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"