Formular to search through table

FelixExcel

New Member
Joined
Sep 14, 2022
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Hey all,

I have a table that has one column of dates, one column of days and one column of calender weeks.

For example:

Date Day Week
30.10.22 Monday 40
31.11.22 Tuesday 40
01.10.22 Wednesday 40
30.11.23 Friday 44

I would like excel to find the date if I give it the week and the day. For example, if I write 40 in cell A1 and Monday in Cell A2 I want excel to search through my table and give me back the date that is in the same row as 40 and Monday, so 30.10.22.

I'm sure there is a formula to do this, but I just can't get it to work.

Any help is appreciated. :)
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Hey all,

I have a table that has one column of dates, one column of days and one column of calender weeks.

For example:

Date Day Week
30.10.22 Monday 40
31.11.22 Tuesday 40
01.10.22 Wednesday 40
30.11.23 Friday 44

I would like excel to find the date if I give it the week and the day. For example, if I write 40 in cell A1 and Monday in Cell A2 I want excel to search through my table and give me back the date that is in the same row as 40 and Monday, so 30.10.22.

I'm sure there is a formula to do this, but I just can't get it to work.

Any help is appreciated.

Just to make it clear, the table has a lot of dates, so each weekday and calender week appear more then once in the table. But the combination of a specific day and a specific calender week only exists once in the table.
 
Upvote 0
the combination of a specific day and a specific calender week only exists once in the table.
In that case, and since you have updated your version (thanks for that), try

22 09 30.xlsm
ABCDEFG
1DateDayWeekWeek40
230.10.22Monday40DayTuesday
331.11.22Tuesday40Date31.11.22
401.10.22Wednesday40
530.11.23Friday44
Sheet2 (2)
Cell Formulas
RangeFormula
G3G3=FILTER(A2:A5,(C2:C5=G1)*(B2:B5=G2))
 
Upvote 0
Solution
In that case, and since you have updated your version (thanks for that), try

22 09 30.xlsm
ABCDEFG
1DateDayWeekWeek40
230.10.22Monday40DayTuesday
331.11.22Tuesday40Date31.11.22
401.10.22Wednesday40
530.11.23Friday44
Sheet2 (2)
Cell Formulas
RangeFormula
G3G3=FILTER(A2:A5,(C2:C5=G1)*(B2:B5=G2))
Thank you so much. It works perfect. I tried to find a solution with index match because I didnt know about the filter function. Happy to have learned something new today :)
 
Upvote 0
You're welcome.

I tried to find a solution with index match
You could use INDEX/MATCH (or XLOOKUP as suggested above) but if doing that I would generally recommend using a delimiter to avoid possible errors due to false matches. That would not happen with this particular data anyway, but a good safety measure habit.

22 10 01.xlsm
ABCDEFG
1DateDayWeekWeek40
230.10.22Monday40DayTuesday
331.11.22Tuesday40Date31.11.22
401.10.22Wednesday4031.11.22
530.11.23Friday44
Match
Cell Formulas
RangeFormula
G3G3=INDEX(A2:A5,MATCH(G1&"|"&G2,C2:C5&"|"&B2:B5,0))
G4G4=XLOOKUP(G1&"|"&G2,C2:C5&"|"&B2:B5,A2:A5)


Here is an example of how errors can occur without the delimiter. We can see by looking that the expected result is Name 3, but without the delimiters, we get a different result.
There is nothing special about "|" as the delimiter, it just needs to be something that will not already occur in the data.

22 10 01.xlsm
ABCDEFGH
1NameValue 1Value 2Value 220T
2Name 1T220Value 12
3Name 2430X
4Name 3220TWith delimitersWithout
5Name 4T530NameName 3Name 1
6Name 3Name 1
Match (2)
Cell Formulas
RangeFormula
G5G5=INDEX(A2:A5,MATCH(G1&"|"&G2,C2:C5&"|"&B2:B5,0))
H5H5=INDEX(A2:A5,MATCH(G1&G2,C2:C5&B2:B5,0))
G6G6=XLOOKUP(G1&"|"&G2,C2:C5&"|"&B2:B5,A2:A5)
H6H6=XLOOKUP(G1&G2,C2:C5&B2:B5,A2:A5)
 
Upvote 0

Forum statistics

Threads
1,215,029
Messages
6,122,757
Members
449,094
Latest member
dsharae57

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