Excel formula to input value from date into "calender"

steefq

New Member
Joined
Oct 17, 2021
Messages
24
Office Version
  1. 365
Platform
  1. Windows
Hello,

I need help with Excel. I have a sheet where I paste data that includes dates and the amount of weight (in kilograms).

In the data I paste, there are 30 entries for 30 days, or 31 entries if it's a 31-day month.

I've created another sheet for Monday to Friday, essentially a "calendar" with 31 days. In the data I'm pasting, let's assume there are 30 days.

Now, I want each day from the data I'm pasting to populate on the second sheet. I want the sheet to allow me to select a year and a month, and then it should fetch the data for that chosen month. Specifically, it should display the kilograms for each Monday through Friday.

Could you assist me with this?

DateFakturanrKvantitetEnhetSumma kgKontaminationÅrMånadDagWeekDay
2023-08-3190646661
3 760​
Kg
3 760​
2023​
8​
31​
4​
2023-08-3090646661
3 100​
Kg
3 100,00​
2023​
8​
30​
3​
2023-08-2990646661
4 360​
Kg
4 360​
2023​
8​
29​
2​
2023-08-2890646661
6 520​
Kg
6 520​
2023​
8​
28​
1​
2023-08-2590646661
2 520​
Kg
2 520​
2023​
8​
25​
5​
2023-08-2490646661
2 840​
Kg
2 840​
2023​
8​
24​
4​
2023-08-2390646661
4 320​
Kg
4 320​
2023​
8​
23​
3​
2021-09-22​
90646661
3 740​
Kg
3 740,00​
2021​
9​
22​
3​
2023-08-2190646661
7 080​
Kg
7 080​
2023​
8​
21​
1​
2023-08-1890646661
8 180​
Kg
8 180,00​
2023​
8​
18​
5​
2023-08-1790646661
6 940​
Kg
6 940​
2023​
8​
17​
4​
2023-08-1690646661
4 800​
Kg
4 800​
2023​
8​
16​
3​
2023-08-1590646661
3 500​
Kg
3 500​
2023​
8​
15​
2​
2023-08-1490646661
8 220​
Kg
8 220​
2023​
8​
14​
1​
2023-08-1190646661
4 020​
Kg
4 020​
2023​
8​
11​
5​
2023-08-1090646661
6 160​
Kg
6 160​
2023​
8​
10​
4​
2023-08-0990646661
6 980​
Kg
6 980​
2023​
8​
9​
3​
2023-08-0890646661
3 220​
Kg
3 220​
2023​
8​
8​
2​
2023-08-0790646661
7 420​
Kg
7 420,00​
2023​
8​
7​
1​
2023-08-0790646661
4 060​
Kg
4 060,00​
2023​
8​
7​
1​
2023-08-0490646661
4 260​
Kg
4 260​
2023​
8​
4​
5​
2023-08-0390646661
5 760​
Kg
5 760​
2023​
8​
3​
4​
2023-08-0290646661
5 360​
Kg
5 360​
2023​
8​
2​
3​
2023-08-0190646661
4 160​
Kg
4 160​
2023​
8​
1​
2​

How can i by the data that i paste populate the table with Monday to Friday?
So for each date if its a monday it should be put in monday and etc.

MondayTuesdayWednesdayThursdayFriday
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
How about one of these options?:
I changed your data you had two 2023-08-07. Or is that not an error and you could have more than one weight for one day? In that case what would you wanna do with those values? add them up?


Libro1
ABCDEFGHIJKLMN
1DateWeight
22023-08-31 ju3760Dateago-23
32023-08-30 mi3100
42023-08-29 ma4360lumamijuvilumamijuvi
52023-08-28 lu652031010203047420822070806520
62023-08-25 vi2520-536057604260406053603220350037404360
72023-08-24 ju2840070809101157606980480043203100
82023-08-23 mi43207420322069806160402042606160694028403760
92023-08-22 ma374014151617184060402081802520
102023-08-21 lu708082203500480069408180
112023-08-18 vi81802122232425
122023-08-17 ju694070803740432028402520
132023-08-16 mi48002829303101
142023-08-15 ma35006520436031003760-
152023-08-14 lu8220
162023-08-11 vi4020
172023-08-10 ju6160
182023-08-09 mi6980
192023-08-08 ma3220
202023-08-07 lu7420
212023-08-04 vi4060
222023-08-03 ju4260
232023-08-02 mi5760
242023-08-01 ma5360
25
26
27
28
29
30
31
32
Hoja1
Cell Formulas
RangeFormula
D4:H4D4=D5
D5D5=LET(d,SEQUENCE(7,,E2-6), MAX((WEEKDAY(d)=2)*d))
E5:H5,E7:H7,E9:H9,E11:H11,E13:H13E5=D5+1
D6:H6,D8:H8,D10:H10,D12:H12,D14:H14D6=SUM(D_Weights*(D5=D_Dates)*(YEAR(D5)=YEAR($E$2))*(MONTH(D5)=MONTH($E$2)))
D7,D9,D11,D13D7=H5+3
J4:N9J4=LET(d,SEQUENCE(7,,E2-6), firstMonday,MAX((WEEKDAY(d)=2)*d), header, SEQUENCE(,5,firstMonday), data,FILTER(SORT(HSTACK(D_Dates,D_Weights),1),(YEAR(D_Dates)=YEAR($E$2))*(MONTH(E2)=MONTH(E2))), emptyDays,WEEKDAY(MIN(CHOOSECOLS(data,1)))-2, w,IFERROR(WRAPCOLS(IF(emptyDays>0,VSTACK(EXPAND("",emptyDays,,""),CHOOSECOLS(data,2)),CHOOSECOLS(data,2)),5),""), VSTACK(header,w) )
Dynamic array formulas.
Named Ranges
NameRefers ToCells
D_Dates=Hoja1!$A$2:$A$32J4, D14:H14, D12:H12, D10:H10, D8:H8, D6:H6
D_Weights=Hoja1!$B$2:$B$32J4, D14:H14, D12:H12, D10:H10, D8:H8, D6:H6
Cells with Data Validation
CellAllowCriteria
E2List=Dates
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,171
Members
453,021
Latest member
Justyna P

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