VLOOKUP with 2 criterias

LaurenHancy

Board Regular
Joined
Aug 5, 2010
Messages
179
Hi All,

I am having a real problem with return the time of a cell using 2 criterias:

This is the data table:

A B C D

1 02/01/19 John 08:16 06:40
2 03/01/19 Bob 08:20 05:30
3 04/05/19 John 09:45 06:44
4 04/03/19 David 08:20 07:55

I am wanting to do an index search as per the following into each date collumn I have. As the referance collumns are not underneath each other, my VLOOKup doesnt work, it just returns #N/A.

=VLOOKUP(A6&D5, RAW_UserAvSum_DATA, 3,FALSE)

A6 = Name
D5 = Date

I want to return Collumn C, first time record.

Thank you for helping me x
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Re: Please help me, I'm stuck :) - VLOOKUP with 2 criterias

Try like this:

=INDEX(C1:C4,MATCH(1,INDEX((A1:A4=D5)*(B1:B4=A6),0),0))
 
Upvote 0
Re: Please help me, I'm stuck :) - VLOOKUP with 2 criterias

not a vlookup() solution


Book1
ABCD
102/01/2019John08:1606:40
203/01/2019Bob08:2005:30
304/05/2019John09:4506:44
404/03/2019David08:2007:55
5
604/05/2019John09:45
Sheet9
Cell Formulas
RangeFormula
C6=SUMPRODUCT(--($A$1:$A$4=A6),--($B$1:$B$4=B6),$C$1:$C$4)
 
Upvote 0
Re: Please help me, I'm stuck :) - VLOOKUP with 2 criterias

not a vlookup() solution

ABCD
102/01/2019John08:1606:40
203/01/2019Bob08:2005:30
304/05/2019John09:4506:44
404/03/2019David08:2007:55
5
604/05/2019John09:45

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet9

Worksheet Formulas
CellFormula
C6=SUMPRODUCT(--($A$1:$A$4=A6),--($B$1:$B$4=B6),$C$1:$C$4)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

That has a bit of a problem should there be two entries for the same person on the same date.
 
Upvote 0
Re: Please help me, I'm stuck :) - VLOOKUP with 2 criterias

Hi,

A quick and easy way to achieve this would be to insert a column before column A and enter =CONCATENATE(D2,C2). This would be C2 and B2 in your table above but I have inserted a column. So that covers the what you are looking up.

Then change you lookup to: =VLOOKUP(A6&D5,RAW_UserAvSum_DATA, 5,FALSE)

That should do it.

Hope that helps
 
Upvote 0
Re: Please help me, I'm stuck :) - VLOOKUP with 2 criterias

Hi All,

I have tried all of the above but it doesnt seem to work. I have tried concertrating 2 collumns then using Vlookup function, also tried Sum Product, but nothing seems to work all I get is #N/A.
 
Last edited by a moderator:
Upvote 0
Re: Please help me, I'm stuck :) - VLOOKUP with 2 criterias

Find the row where you expect the solution to be found. Then check that cell A6 equals the name and cell D5 equals the date of that same row.

eg.

=A6=B1

and

=D5=A1

because at least one must be false.
 
Upvote 0
Re: Please help me, I'm stuck :) - VLOOKUP with 2 criterias

Hi Steve,

The result returns 00:00:00

I am using the following forular to be exact:

=SUMPRODUCT(--('RAW - UserAvSummary'!$B$8:$B$5000=A6),--('RAW - UserAvSummary'!$A$8:$A$5000=D5),'RAW - UserAvSummary'!$C$8:$C$5000)

A6 = Name
D5 = Date

I am not too sure what I am doing wrtong?
 
Upvote 0
Re: Please help me, I'm stuck :) - VLOOKUP with 2 criterias

results from post #2 & #3's formula


Book1
ABCD
102/05/2019John08:1606:40
203/01/2019Bob08:2005:30
304/05/2019John09:4506:44
404/03/2019David08:2007:55
504/05/2019
6John09:45
7
809:45
Sheet9
Cell Formulas
RangeFormula
C6=SUMPRODUCT(--($A$1:$A$4=D5),--($B$1:$B$4=A6),$C$1:$C$4)
C8=INDEX(C1:C4,MATCH(1,INDEX((A1:A4=D5)*(B1:B4=A6),0),0))
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,525
Members
449,088
Latest member
RandomExceller01

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