Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
LB
 
Posts: n/a
Default Which Function(s) do I use?

Does anyone know which function(s) I can use to pull certain names from a
list that meet either of two criteria? Below is list of all products
available: I only want to pull products and corresponding data that either
do not have "sub-product" (i.e. Product A,C,D) or is labled "sub-product;1"
(i.e. Product B;1, Product E;1 Product F;1).

Product Name Total Sales
Product A 5
Product B;1 10
Product B;2 15
Product B;3 2
Product C 50
Product D 20
Product E;1 25
Product E;2 10
Product E;3 31
Product F;1 34
Product F;2 20
Product G 50
Product H 34



  #2   Report Post  
George Nicholson
 
Posts: n/a
Default

Assuming
1) your Product table is a 2 column named range called Products
2) Column A contains the value you want to look up in the table.

=IF(ISNA(VLOOKUP(B2,Products,2,FALSE)),0,VLOOKUP(B 2,Products,2,FALSE))
If B2 = Product A, the formula returns 5
If B2 = Product Z (not in the list) the formula returns 0

If you would prefer that the formula return #N/A if the product isn't in the
list you can use this simpler variation instead:
=VLOOKUP(B2,Products,2,FALSE)

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"LB" wrote in message
...
Does anyone know which function(s) I can use to pull certain names from a
list that meet either of two criteria? Below is list of all products
available: I only want to pull products and corresponding data that
either
do not have "sub-product" (i.e. Product A,C,D) or is labled
"sub-product;1"
(i.e. Product B;1, Product E;1 Product F;1).

Product Name Total Sales
Product A 5
Product B;1 10
Product B;2 15
Product B;3 2
Product C 50
Product D 20
Product E;1 25
Product E;2 10
Product E;3 31
Product F;1 34
Product F;2 20
Product G 50
Product H 34





  #3   Report Post  
LB
 
Posts: n/a
Default

Thanks George. If I only have one column containing the product names, how do
I pull in the name of the product that does not have "sub-product" or is
"sub-product;1" (i.e. Product B;1, Product E;1 Product F;1).

In other words, I only want to pull in the following product names from my
master list below:
Product A
Product B;1
Product C
Product D
Product E;1
Product F;1
Product G
Product H

I'm not sure which functions I should use.


"George Nicholson" wrote:

Assuming
1) your Product table is a 2 column named range called Products
2) Column A contains the value you want to look up in the table.

=IF(ISNA(VLOOKUP(B2,Products,2,FALSE)),0,VLOOKUP(B 2,Products,2,FALSE))
If B2 = Product A, the formula returns 5
If B2 = Product Z (not in the list) the formula returns 0

If you would prefer that the formula return #N/A if the product isn't in the
list you can use this simpler variation instead:
=VLOOKUP(B2,Products,2,FALSE)

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"LB" wrote in message
...
Does anyone know which function(s) I can use to pull certain names from a
list that meet either of two criteria? Below is list of all products
available: I only want to pull products and corresponding data that either
do not have "sub-product" (i.e. Product A,C,D) or is labled
"sub-product;1"


(i.e. Product B;1, Product E;1 Product F;1).


Product Name Total Sales
Product A 5
Product B;1 10
Product B;2 15
Product B;3 2
Product C 50
Product D 20
Product E;1 25
Product E;2 10
Product E;3 31
Product F;1 34
Product F;2 20
Product G 50
Product H 34






  #4   Report Post  
George Nicholson
 
Posts: n/a
Default

I'm no longer sure what you are trying to do but maybe
=IF(ISNA(VLOOKUP(B2,Products,1,FALSE)),0,VLOOKUP(B 2,Products,1,FALSE))
Where B2 is the Product name and the 1st column of Products is also the
product name.

--
George Nicholson

Remove 'Junk' from return address.


"LB" wrote in message
...
Thanks George. If I only have one column containing the product names, how
do
I pull in the name of the product that does not have "sub-product" or is
"sub-product;1" (i.e. Product B;1, Product E;1 Product F;1).

In other words, I only want to pull in the following product names from my
master list below:
Product A
Product B;1
Product C
Product D
Product E;1
Product F;1
Product G
Product H

I'm not sure which functions I should use.


"George Nicholson" wrote:

Assuming
1) your Product table is a 2 column named range called Products
2) Column A contains the value you want to look up in the table.

=IF(ISNA(VLOOKUP(B2,Products,2,FALSE)),0,VLOOKUP(B 2,Products,2,FALSE))
If B2 = Product A, the formula returns 5
If B2 = Product Z (not in the list) the formula returns 0

If you would prefer that the formula return #N/A if the product isn't in
the
list you can use this simpler variation instead:
=VLOOKUP(B2,Products,2,FALSE)

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"LB" wrote in message
...
Does anyone know which function(s) I can use to pull certain names from
a
list that meet either of two criteria? Below is list of all products
available: I only want to pull products and corresponding data that
either
do not have "sub-product" (i.e. Product A,C,D) or is labled
"sub-product;1"


(i.e. Product B;1, Product E;1 Product F;1).

Product Name Total Sales
Product A 5
Product B;1 10
Product B;2 15
Product B;3 2
Product C 50
Product D 20
Product E;1 25
Product E;2 10
Product E;3 31
Product F;1 34
Product F;2 20
Product G 50
Product H 34








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
how do I use multiple nested functions? TeeJay Excel Worksheet Functions 3 February 20th 05 05:09 PM
PivotTable canned functions doco Excel Discussion (Misc queries) 0 January 14th 05 03:52 PM
Changing the language of built-in functions? Gustaf Liljegren New Users to Excel 3 December 20th 04 08:31 PM
How to load Engineering Functions into the Fx function wizard? jsaval Excel Worksheet Functions 1 November 11th 04 09:47 PM
Where can I see VBA code for financial functions? eios Excel Worksheet Functions 1 November 2nd 04 01:00 PM


All times are GMT +1. The time now is 09:03 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"