Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Vlookup on multiple items

Hi guys

I have a list of data, 3 columns. Eg.

Code CostCentre Amount
0020 RIC 200.00
0020 LPM 350.00

As you can see the two items have the same code (0020) but different
CostCentre codes (RIC, LPM).
I want to be able to use vlookup (or any other means) to look for data which
has a code or 0020 AND a costcentre of RIC (or LPM). Problem obv with vlookup
is it only looks at the left-most side of data. How can i add an AND
statement to it so it can look up both pieces of data and gives me a result?

Thanks for your time.
Tom.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default Vlookup on multiple items

=SUMPRODUCT(--(a2:a3="0020"),--(b2:b3="RIC"),c2:c3)

"Bazy2k" wrote:

Hi guys

I have a list of data, 3 columns. Eg.

Code CostCentre Amount
0020 RIC 200.00
0020 LPM 350.00

As you can see the two items have the same code (0020) but different
CostCentre codes (RIC, LPM).
I want to be able to use vlookup (or any other means) to look for data which
has a code or 0020 AND a costcentre of RIC (or LPM). Problem obv with vlookup
is it only looks at the left-most side of data. How can i add an AND
statement to it so it can look up both pieces of data and gives me a result?

Thanks for your time.
Tom.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Vlookup on multiple items

Another solution would be to add a helper column in front of your 'code'
column. Then concatenate the code and cost center together (e.g., 0020RIC)
using a formula. copy/paste the formula in front of all your data. Then do
the vlookup on the concatenation.


"Bazy2k" wrote:

Hi guys

I have a list of data, 3 columns. Eg.

Code CostCentre Amount
0020 RIC 200.00
0020 LPM 350.00

As you can see the two items have the same code (0020) but different
CostCentre codes (RIC, LPM).
I want to be able to use vlookup (or any other means) to look for data which
has a code or 0020 AND a costcentre of RIC (or LPM). Problem obv with vlookup
is it only looks at the left-most side of data. How can i add an AND
statement to it so it can look up both pieces of data and gives me a result?

Thanks for your time.
Tom.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Vlookup on multiple items

Thanks Eric but i cant seem to get that to work? What do i have to replace
the '--' with?

What im trying to do is pick the amounts out from the list of codes and cost
centres i have, so i have the list of codes and cost centres here but with no
values yet, i need to be able to look into the download and pick out the
relevant amount relating to that specific code AND cost centre?

so something like =vlookup("0020" and "RIC", Array, 3)?!

Thanks
Tom.

"EricBB" wrote:

=SUMPRODUCT(--(a2:a3="0020"),--(b2:b3="RIC"),c2:c3)

"Bazy2k" wrote:

Hi guys

I have a list of data, 3 columns. Eg.

Code CostCentre Amount
0020 RIC 200.00
0020 LPM 350.00

As you can see the two items have the same code (0020) but different
CostCentre codes (RIC, LPM).
I want to be able to use vlookup (or any other means) to look for data which
has a code or 0020 AND a costcentre of RIC (or LPM). Problem obv with vlookup
is it only looks at the left-most side of data. How can i add an AND
statement to it so it can look up both pieces of data and gives me a result?

Thanks for your time.
Tom.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Vlookup on multiple items

Try the formula as written--don't change anything.

You can djust the ranges to match what you need--but you can't use whole columns
(except in xl2007).

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

Bazy2k wrote:

Thanks Eric but i cant seem to get that to work? What do i have to replace
the '--' with?

What im trying to do is pick the amounts out from the list of codes and cost
centres i have, so i have the list of codes and cost centres here but with no
values yet, i need to be able to look into the download and pick out the
relevant amount relating to that specific code AND cost centre?

so something like =vlookup("0020" and "RIC", Array, 3)?!

Thanks
Tom.

"EricBB" wrote:

=SUMPRODUCT(--(a2:a3="0020"),--(b2:b3="RIC"),c2:c3)

"Bazy2k" wrote:

Hi guys

I have a list of data, 3 columns. Eg.

Code CostCentre Amount
0020 RIC 200.00
0020 LPM 350.00

As you can see the two items have the same code (0020) but different
CostCentre codes (RIC, LPM).
I want to be able to use vlookup (or any other means) to look for data which
has a code or 0020 AND a costcentre of RIC (or LPM). Problem obv with vlookup
is it only looks at the left-most side of data. How can i add an AND
statement to it so it can look up both pieces of data and gives me a result?

Thanks for your time.
Tom.


--

Dave Peterson
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
Can I use VLookup for Multi items? CremeStout Excel Discussion (Misc queries) 2 February 28th 09 05:20 PM
Vlookup, HLOOKUP, To find Multiple items and then sum all in colum Bobberjoe Excel Discussion (Misc queries) 4 January 16th 09 04:42 AM
Want Vlookup to list multiple items with the same key? GarToms Excel Worksheet Functions 13 May 10th 06 11:21 PM
order form with multiple items and sizes for items Bernard56 Excel Discussion (Misc queries) 1 January 17th 06 11:43 PM
Vlookup for 2 items Mostafa Excel Worksheet Functions 11 July 18th 05 10:50 PM


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