Reputation: 157
Click here for an example of what I am trying to do
Given a range of dates and data including names, two options S/BS, and dates.
I've made a table with names in the first row.
I need help to write an Excel formula that will do the following: If a date in the data matches a date in the date range, I need a formula that will place the option S or BS at the correct place under the correct name.
Say we have the date 04/01/2015 for Maria with the option BS. The formula needs to find the row where 04/01/2015 is placed in the date range, ie. row 5 and place it under Maria, ie. column M. This would write BS in M5
The formula needs to work for different data sets with the same dates, ie. it's possible for two or more people to have the same date (Maria and Iben both have the date 04/01/2015).
I've tried using VLOOKUP and INDEX+MATCH, but can't quite make it work. I'm not too familiar with these functions either which makes it even harder.
Upvotes: 0
Views: 1001
Reputation: 152450
Use this array formula:
=IFERROR(INDEX($G$2:$G$7,MATCH($A$2:$A$27,IF($F$2:$F$7=M$1,$H$2:$H$7),0)),"")
Note:
There is a specific order to entering this formula:
{}
around them.Another method: Use this array formula:
=IFERROR(INDEX($G$2:$G$7,MATCH($A2,IF($F$2:$F$7=M$1,$H$2:$H$7),0)),"")
Procedure:
{}
around the formula.One more note, In the test data you provided there is an extra space after the name Thomas in N1. This will need to be removed to test this formula properly. The names must match exactly.
Upvotes: 1