Lookup Values with multiple criteria

Xlitup

New Member
Joined
Jan 16, 2018
Messages
22
Hi,

I am trying to lookup values from another sheet using the following formula:

=INDEX('Sheet2'!C1:C30,MATCH(1,IF('Sheet2'!D1:D30='Sheet1'!B1,IF('Sheet2'!E1:E30>'Sheet1'!F1,IF('Sheet2'!H1:H30>'Sheet1'!G1,1))),0))

It works fine but I would like to have the H1:H30 column of sheet 2 between Sheet1 G1 and Sheet1 G1+6. So more than sheet1 G1 date but less than Sheet1 G1+6months.

It is a little confusing but any help would be great.
Let me know if further clarification is needed.

Cheers.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
In Sheet1, Control+shift+enter, not just enter:

=INDEX('Sheet2'!$C$1:$C$30,MATCH(1,IF('Sheet2'!$D$1:$D$30=$B1,IF('Sheet2'!$E$1:$E$30>$F1,IF('Sheet2'!$H$1:$H$30>$G1,IF(
'Sheet2'!$H$1:$H$30 < EDATE($G1,12*6),1)))),0))
 
Last edited:
Upvote 0
Thanks Aladin,

Yes you are absolutely right Ctrl+Shift+Enter with the formula.

However the formula did not work for me but the following Date formula did work. I don't knoe why did EDate give me different values but the following works just fine.

Thanks for the help.

=INDEX('Sheet2'!$C$1:$C$30,MATCH(1,IF('Sheet2'!$D$1:$D$30=$B1,IF('Sheet2'!$E$1:$E$30>$F1,IF('Sheet2'!$H$1:$H$30>$G1,IF(
'Sheet2'!$H$1:$H$30 < DATE(Year($G1),Month($G1)+6,Day($G1)),1)))),0))
[/QUOTE]
 
Upvote 0
Thanks Aladin,

Yes you are absolutely right Ctrl+Shift+Enter with the formula.

However the formula did not work for me but the following Date formula did work. I don't knoe why did EDate give me different values but the following works just fine.

Thanks for the help.

=INDEX('Sheet2'!$C$1:$C$30,MATCH(1,IF('Sheet2'!$D$1:$D$30=$B1,IF('Sheet2'!$E$1:$E$30>$F1,IF('Sheet2'!$H$1:$H$30>$G1,IF(
'Sheet2'!$H$1:$H$30 < DATE(Year($G1),Month($G1)+6,Day($G1)),1)))),0))

You are welcome.

My bad.

EDATE($G1,6) should give you a 6 months later date.

This is equivalent to:

DATE(YEAR($G1),MONTH($G1)+6,DAY($G1))

but cheaper.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,298
Members
449,077
Latest member
Rkmenon

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