IF and LOOKUP to find value based on two data columns with repeat values?

FlowersinExcel

New Member
Joined
Dec 6, 2019
Messages
16
Office Version
  1. 2016
Platform
  1. Windows
Hi,
I am trying to write a formula that will let me search two big columns of information to spit out a unique value in a third column. I have a list of names, with many repeat names, a level of service provided, and then a start & end date for the dates of service, also with many repeat dates. So I need a formula that says, if the date and the person match, give me the level of service. The problem is that I'll get multiple values for dates and multiple values for names, but only one value where those coincide. I've tried nested IFs and AND formulas, and a LOOKUP formula {LOOKUP(2,1/(start<=date)*(end>=date),Service column)}, but I don't know how to make the lookup formula work with the IF formula since I want excel to find the match. Please help - any suggestions are appreciated.

Here's what I'm trying to do. Specifically, I'm trying to figure out the formula that I can spread across and down for Step 1.
1575657796894.png
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi & welcome to MrExcel.

How about

Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
2Alex501/01/201907/01/201901/01/201902/01/201903/01/201904/01/201905/01/201906/01/201907/01/201908/01/201909/01/201910/01/201911/01/201912/01/201913/01/201914/01/201915/01/201916/01/201917/01/201918/01/201919/01/2019
3Alex408/01/201916/02/2019Alex5555555444444444444
4Alex317/02/201918/02/2019Sam2222222222233333333
5Alex419/02/201904/03/2019
6Sam201/01/201911/01/2019
7Sam312/01/201923/02/2019
Wk42HS
Cell Formulas
RangeFormula
H3:Z4H3=IFERROR(INDEX($B$2:$B$100,AGGREGATE(15,6,(ROW($B$2:$B$100)-ROW($B$2)+1)/(($A$2:$A$100=$G3)*($C$2:$C$100<=H$2)*($D$2:$D$100>=H$2)),1)),"")
 
Upvote 0
Hi @FlowersinExcel, welcome to the board!

Try this

Book1
ABCDEFGHIJKLMNOPQ
1
2StudentLevelStartDateEndDateStep 1
3Alex501/01/201907/01/2019Student01/01/201902/01/201903/01/201904/01/201905/01/201906/01/201907/01/201908/01/201909/01/201910/01/201911/01/2019
4Alex408/01/201916/02/2019Alex55555554444
5Alex317/02/201918/02/2019Sam  44444444 
6Alex419/02/201904/03/2019Chris    5552233
7Sam403/01/201910/01/2019
8Sam311/01/201910/01/2019
9Sam221/01/201927/02/2019
10Chris505/01/201907/01/2019
11Chris208/01/201909/01/2019
12Chris310/01/201914/01/2019
13Chris215/01/201917/01/2019
14Chris318/01/201931/01/2019
sheet
Cell Formulas
RangeFormula
G4:Q6G4=IFERROR(INDEX($B$3:$B$14,SUMPRODUCT(($A$3:$A$14=$F4)*($C$3:$C$14<=G$3)*($D$3:$D$14>=G$3)*ROW($B$3:$B$14))-ROW($A$3)+1),"")
 
Upvote 0
Solution

Forum statistics

Threads
1,214,951
Messages
6,122,442
Members
449,083
Latest member
Ava19

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