Reputation: 45
maybe you can help me on this.
I need a Excel formula to lookup for all multiple events on a same day:
So this:
DATE EVENT SEARCH DATE HERE> 21/01
21/01 A
21/01 B
21/01 A
21/01 A
22/01 A
22/01 B
23/01 B
Would become this:
DATE EVENT
21/01 A
21/01 B
21/01 A
21/01 A
I was trying to use this:
{=IFERROR(INDEX($A$1:$B$8,SMALL(IF(A2:A8=$F$1,ROW(A2:A8)-1),ROW(A1)),2),"")}
Which works well looking for values, but not looking for dates..
Any idea why? Thank you!
Upvotes: 1
Views: 1996
Reputation: 2519
I got what you asking for simply using:
=IF($A2=$F$1,$A2,"")
and
=IF($A2=$F$1,$B2,"")
under the date and event columns, respectively in the filtered result list.
Also, in your formula, the "if" only has 2 parameters. Is this intentional?
You can also filter by the following:
Select the date and events cells
Click Format as Table, check My table has headers and hit OK.
Click on the down arrow next to the column header, and choose Filter.
Upvotes: 1
Reputation: 152450
Applying a filter would be best but if you want a formula:
=IFERROR(INDEX(A:A,AGGREGATE(15,6,(1/($A:$A=$D$1))*ROW($1:$1040000),ROW(1:1))),"")
Copy over and down as many rows as wanted. The picture the formula was copied down 8 rows.
The Aggregate function is new to Excel 2010 so any that are older than that it will not work.
Upvotes: 1