View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Lookup assistance needed

This may not be the best approach, but I'd do one of two things...

Option 1.

Add another column to the raw data and build a pivottable using that as the only
row field. This additional field would concatenate the center and client.

=a2&"--"&b2
(and drag down)

Then I could use something like this:
=vlookup(x9&"--"&y9,....
Where x9 held the center and y9 held the client.


Option 2.

Convert the existing pivottable to values (or create a copy of just values on a
different sheet). Then fill all those empty cells with the value from above.

Debra Dalgleish shares a few techniques here (manual and macro):

http://contextures.com/xlDataEntry02.html
and a video
http://www.contextures.com/xlVideos01.html#FillBlanks

Then use another formula to retrieve the value you want.

=sumproduct(--(sheet99!A1:A10="center1"),--(sheet99!b1:b10="client1"),(c1:c10))

Adjust the ranges to match--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

Some added info that I've saved from a previous post:

If you want exact matches for just two columns (and return a value from a
third), you could use:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0))

(all in one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can only use the whole column in xl2007.

This returns the value in othersheet column C when column A and B (of
othersheet) match A2 and B2 of the sheet with the formula.

And you can add more conditions by just adding more stuff to that product
portion of the formula:

=index(othersheet!$d$1:$d$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0))

============
If there is only one match and you're bringing back a number (or 0 if there is
no match for all the criteria), you can use:

=sumproduct(--(othersheet!a1:a10=a1),
--(othersheet!b1:b10=b1),
(othersheet!c1:c10))

HowardM wrote:

I have a pivot table of data that I would like to complete a lookup on. The
data is in a pivot table because I need some of the data grouped before I
complete the lookup on it. I am trying to complete a lookup that first finds
the Center then looks for the Client. Once the correct Center and Client are
found, then I want it to look up the Month and return the data point. So if
I have it lookup Center2, Client4 for Mar., it would return the value of 48.
See example table below:

A B C D E
1 Center Client Jan Feb Mar

2 Center1 Client 1 22 3 25
3 Client 2 131 108 107
4 Client 3 4 0 0
5 Client 4 25 24 24
6 Client 5 1 0 7
7 Center1 Total 161 135 138
8 Center2 Client 1 0 0 0
9 Client 2 20 4 4
10 Client 3 0 1 6
11 Client 4 36 32 48
12 Client 5 11 1 2
13 Center2 Total 67 38 60

Any ideas on how to set up the lookup would be greatly appreciated.


--

Dave Peterson