Vlookup problem

phil_r

New Member
Joined
Oct 16, 2002
Messages
19
I'm trying to get data out of a table (database), according 2 criteria.

Example:
Column1: location
Column2: month
Columuns: data1

Location Month data1
Geneva January 23
Paris January 34
Geneva February 26
Paris February 19

How can I get data1 corresponding to Location(x)-Month(y)?

Typical Query: value of data1 in February in Geneva.
Expected outcome: 26

How can I do that?

Thanks in advance
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

s-o-s

Active Member
Joined
Apr 14, 2002
Messages
384
On 2002-10-17 08:00, phil_r wrote:
I'm trying to get data out of a table (database), according 2 criteria.

Example:
Column1: location
Column2: month
Columuns: data1

Location Month data1
Geneva January 23
Paris January 34
Geneva February 26
Paris February 19

How can I get data1 corresponding to Location(x)-Month(y)?

Typical Query: value of data1 in February in Geneva.
Expected outcome: 26

How can I do that?

Thanks in advance

If your data is in rows 2 - 11.

In A15 enter Location Name ie PARIS
In A16 Enter month January (May be wise to format Month as Text that way it will eliminate a problem with different days in a month)

A17 = SUMPRODUCT((A2:A11=A15)*(B2:B11=A16)*(B2:B11))



_________________
Hope This Helps.
Sean.<A HREF= "http://website.lineone.net/~s-o-s/Index.html">
image001.gif

Win98, XL2000

edit to change A16 to A17
This message was edited by s-o-s on 2002-10-17 08:13
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
This formula:

=SUMPRODUCT((A2:A5="Geneva")*(B2:B5="February"),C2:C5)

You can replace hard coded bits eg "Geneva" with cell references.
 

Forum statistics

Threads
1,144,275
Messages
5,723,449
Members
422,497
Latest member
dougy99

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
Top