Using VLookups and If Statements Together

simm5580

New Member
Joined
Mar 4, 2015
Messages
3
I think I need to combine a Vlookup and IF statement together. Basically, I have a list of participants with a medication start date and I also have a list of medical reports for each of those participants (note: each participant has more than 1 medical report). Essentially, I would like to pull out 1 value from the medical report closest to the start of the medication (before medication start date not after).
 
[TABLE="width: 177"]
<tbody>[TR]
[TD="colspan: 2"]Sheet 1[/TD]
[/TR]
[TR]
[TD]Study ID[/TD]
[TD]Medication Start[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD="align: right"]2010/12/13[/TD]
[/TR]
</tbody>[/TABLE]


[TABLE="width: 378"]
<tbody>[TR]
[TD]Sheet 2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Study ID[/TD]
[TD]Medical Report Date[/TD]
[TD]Medical report Value[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD="align: right"]2014/10/20[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD="align: right"]2013/12/13[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD="align: right"]2010/12/11[/TD]
[TD="align: right"]30[/TD]
[/TR]
</tbody>[/TABLE]


In this case, I would like it to pull out the Medical Report Value "30" since the date is prior to the "Medication Start Date"
 
Upvote 0
how is the data structured
can you put a link to a example file on dropbox or onedrive?
 
Upvote 0
Unfortunately not. It is structured across two sheets.

Sheet 1 - Contains Study ID (listed down rows) & medication start Date (1 column)
Sheet 2 - Contains study ID with multiple reports for each study ID (listed down rows), the date for each Medical Report, the Medical Value for each report.
 
Upvote 0
You're making this hard! Is there only 1 Study ID? Are the dates sorted? If so Ascending or Descending?
 
Upvote 0

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