# Vlookup problem

#### phil_r

##### New Member
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?

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

How can I do that?

### Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

#### s-o-s

##### Active Member
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?

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

How can I do that?

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">

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
This formula:

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

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

#### phil_r

##### New Member
Fantastic!!!
Thank you very much.
Regards
Phil

Replies
3
Views
302
Replies
3
Views
562
Replies
1
Views
106
Replies
4
Views
421
Replies
1
Views
119

1,181,311
Messages
5,929,242
Members
436,657
Latest member
ssims

### 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.

### Which adblocker are you using?

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

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