Multiple Lookup Query

dominicwellsuk

New Member
Joined
Mar 23, 2011
Messages
28
Hi, I'm trying to set up a sheet of data from which I can lookup all values against a particular name, regardless of where they are in the list, and there will multiple lines for each name. I think pivot tables woud do the job, but for various reasons they're not suitable.

Imagine this golfing example for scores on each hole...

Name Course 1st 2nd 3rd 4th 5th etc.....
J.Smith Peabeck 4 5 3 5 4
J.Doe Quagmire 3 4 4 4 6
J.Smith Peabeck 3 5 3 4 5
J.Doe Peabeck 4 4 3 6 3
J.Smith Quagmire 5 5 4 4 4

Is there a way of calculating for example, how many scores of "4" J.Doe has got on hole 2 at "Quagmire", or getting an average number of shots for J.Smith on hole 5 at Peabeck? (Names have been changed to protect the innocent).

This might be a really simple problem, but my mind is failing me. Any creative types out there without pre-bank holiday concentration levels?

Thanks :)
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi, I'm trying to set up a sheet of data from which I can lookup all values against a particular name, regardless of where they are in the list, and there will multiple lines for each name. I think pivot tables woud do the job, but for various reasons they're not suitable.

Imagine this golfing example for scores on each hole...

Name Course 1st 2nd 3rd 4th 5th etc.....
J.Smith Peabeck 4 5 3 5 4
J.Doe Quagmire 3 4 4 4 6
J.Smith Peabeck 3 5 3 4 5
J.Doe Peabeck 4 4 3 6 3
J.Smith Quagmire 5 5 4 4 4

Is there a way of calculating for example, how many scores of "4" J.Doe has got on hole 2 at "Quagmire", or getting an average number of shots for J.Smith on hole 5 at Peabeck? (Names have been changed to protect the innocent).

This might be a really simple problem, but my mind is failing me. Any creative types out there without pre-bank holiday concentration levels?

Thanks :)
What version of Excel are you using?

Also, are the hole numbers really ordinal numbers: 1st 2nd 3rd 4th 5th etc.....

Or, are they: 1 2 3 4 5 etc...
 
Upvote 0
Sorry, should have said, I'm using 2003, and the hole numbers are formatted as "1st", "2nd" etc at the moment, but that's not critical. They can be 1,2,3 etc.
 
Upvote 0
Sorry, should have said, I'm using 2003, and the hole numbers are formatted as "1st", "2nd" etc at the moment, but that's not critical. They can be 1,2,3 etc.
OK, with your data as such:

Book1
ABCDEFG
1NameCourse12345
2J.SmithPeabeck45354
3J.DoeQuagmire34446
4J.SmithPeabeck35345
5J.DoePeabeck44363
6J.SmithQuagmire55444
Sheet1

average number of shots for J.Smith on hole 5 at Peabeck?
Use cells to hold the criteria:
  • A11 = J.Smith
  • B11 = Peabeck
  • C11 = 5
Array entered**:

=AVERAGE(IF(A2:A6=A11,IF(B2:B6=B11,INDEX(C2:G6,,C11))))

** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.

how many scores of "4" J.Doe has got on hole 2 at "Quagmire"
  • A11 = J.Doe
  • B11 = Quagmire
  • C11 = 2
  • D11 = 4
=SUMPRODUCT(--(A2:A6=A11),--(B2:B6=B11),--(INDEX(C2:G6,,C11)=D11))
 
Upvote 0
Exquisite Excelmanship sir.

This might be obvious after what you've said so sorry, but for the last example, if I wanted to remove the constraint of a particular course and particular hole, how would that be shown in the formula?

Thanks.
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top