Populate Date With Criteria

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
951
Office Version
  1. 365
Hi,

I have the following table:
Lifetime Planner_2024 v.4.xlsx
DJDKDLDMDNDODPDQDRDSDTDUDVDW
1MonFoodLunch8Start Date10/7/202410/7/2024MonFoodLunch8
2MonFoodDinner8Holiday10/9/202410/7/2024MonFoodDinner8
3MonAltarFlower1510/10/202410/7/2024MonAltarFlower15
4MonFoodBread3.510/7/2024MonFoodBread3.5
5TueFoodLunch810/8/2024TueFoodLunch8
6TueFoodDinner810/8/2024TueFoodDinner8
7TueAutomobileToll1.7210/8/2024TueAutomobileToll1.72
8TueAutomobileToll10.7510/8/2024TueAutomobileToll10.75
9WedFoodLunch810/11/2024FriAutomobileToll1.72
10WedFoodDinner810/11/2024FriAutomobileToll10.75
11WedAutomobileToll1.7210/11/2024FriFoodLunch8
12WedAutomobileToll10.7510/12/2024SatAutomobileFuel60
13ThuFoodLunch810/13/2024SunFoodDrink10
14ThuFoodDinner8
15ThuAutomobileToll1.72
16ThuAutomobileToll10.75
17FriAutomobileToll1.72
18FriAutomobileToll10.75
19FriFoodLunch8
20SatAutomobileFuel60
21SunFoodDrink10
Daily Expense Tracker
Cell Formulas
RangeFormula
DT1:DW13DT1=FILTER($DJ$1:$DM$21, ISNUMBER( XMATCH($DJ$1:$DJ$21, TEXT( WORKDAY.INTL($DQ$1-1, SEQUENCE(NETWORKDAYS.INTL($DQ$1,$DQ$1+7-WEEKDAY($DQ$1,2),"0000000",$DQ$2:$DQ$6)), "0000000", $DQ$2:$DQ$6), "ddd"), 0)))
Dynamic array formulas.


Column DJ to DM shows the fixed expenses that will be incurred every week (Mon-Sun). Cell DQ1 shows the start day of the week. DQ2 to DQ6 shows the public holidays. Column DT to DW shows the expenses populated based on the start date and excludes the public holidays.

Is there a way to populate the dates as well in column DS ? Appreciate all the help.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Like this? I have just added a bit to the existing formula (though I did also remove all the "$" signs from that original formula as they are not required and just clutter the formula).

24 10 09.xlsm
DJDKDLDMDNDODPDQDRDSDTDUDVDW
1MonFoodLunch8Start Date7/10/20247/10/2024MonFoodLunch8
2MonFoodDinner8Holiday9/10/20247/10/2024MonFoodDinner8
3MonAltarFlower1510/10/20247/10/2024MonAltarFlower15
4MonFoodBread3.57/10/2024MonFoodBread3.5
5TueFoodLunch88/10/2024TueFoodLunch8
6TueFoodDinner88/10/2024TueFoodDinner8
7TueAutomobileToll1.728/10/2024TueAutomobileToll1.72
8TueAutomobileToll10.758/10/2024TueAutomobileToll10.75
9WedFoodLunch811/10/2024FriAutomobileToll1.72
10WedFoodDinner811/10/2024FriAutomobileToll10.75
11WedAutomobileToll1.7211/10/2024FriFoodLunch8
12WedAutomobileToll10.7512/10/2024SatAutomobileFuel60
13ThuFoodLunch813/10/2024SunFoodDrink10
14ThuFoodDinner8
15ThuAutomobileToll1.72
16ThuAutomobileToll10.75
17FriAutomobileToll1.72
18FriAutomobileToll10.75
19FriFoodLunch8
20SatAutomobileFuel60
21SunFoodDrink10
Include Date
Cell Formulas
RangeFormula
DS1:DW13DS1=LET(f,FILTER(DJ1:DM21, ISNUMBER( XMATCH(DJ1:DJ21, TEXT( WORKDAY.INTL(DQ1-1, SEQUENCE(NETWORKDAYS.INTL(DQ1,DQ1+7-WEEKDAY(DQ1,2),"0000000",DQ2:DQ6)), "0000000", DQ2:DQ6), "ddd"), 0))), d,BYROW(TAKE(f,,1),LAMBDA(r,DQ1+(FIND(r,"MonTueWedThuFriSatSun")-1)/3)), HSTACK(d,f))
Dynamic array formulas.
 
Upvote 0
Solution
Hi Peter,

Thank you for the solution. That worked. Appreciate it and have a great day.🙏
 
Upvote 0
I don't know if this matters, but formula from Post #3 seems to stumble if the start date is a non-Monday. If this does matter, here is an alternative approach:
Excel Formula:
=LET(c,INDEX(DJ1:DJ21,MATCH(TEXT(DQ1,"ddd"),DJ1:DJ21,0)),d,DQ1-WEEKDAY(DQ1,11)+(SEARCH(c:DJ21,"MonTueWedThuFriSatSun")+2)/3,FILTER(HSTACK(d,c:DM21),ISNA(XMATCH(d,DQ2:DQ6,0))))
 
Upvote 0
I don't know if this matters, but formula from Post #3 seems to stumble if the start date is a non-Monday.
You are right, but I believe that we were given that information in post 1
Column DJ to DM shows the fixed expenses that will be incurred every week (Mon-Sun). Cell DQ1 shows the start day of the week
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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