Skip i'r prif gynnwys

Sut i dalgrynnu dyddiad i ddiwrnod wythnos blaenorol blaenorol neu nesaf yn Excel?

doc-rownd-i-flaenorol-dydd sul-1
Weithiau, efallai y bydd angen i chi gael y diwrnod wythnos blaenorol neu nesaf penodol fel dydd Sul yn seiliedig ar ddyddiad fel y sgrinlun chwith a ddangosir. Yma mae'r tiwtorial hwn yn darparu dwy fformiwla ar gyfer trin y swydd hon yn hawdd yn Excel.
Dyddiad talgrynnu i ddiwrnod penodol nesaf o'r wythnos
Dyddiad talgrynnu i ddiwrnod wythnos penodol blaenorol

swigen dde glas saeth Dyddiad talgrynnu i ddiwrnod wythnos Penodol nesaf

Er enghraifft, yma i gael dydd Sul nesaf y dyddiadau yng ngholofn A

1. Dewiswch gell yr ydych am ei gosod y dyddiad Sul nesaf, yna pastiwch neu nodwch isod y fformiwla:

=IF(MOD(A2-1,7)>7,A2+7-MOD(A2-1,7)+7,A2+7-MOD(A2-1,7))

2. Yna pwyswch Rhowch allweddol i gael y dydd Sul nesaf cyntaf, sy'n cael ei arddangos fel rhif 5-digid, yna llusgo auto llenwi i lawr i gael yr holl ganlyniadau.

doc-rownd-i-flaenorol-dydd sul-1

3. Yna cadwch y celloedd fformiwla a ddewiswyd, pwyswch Ctrl + 1 allweddi i arddangos y Celloedd Fformat deialog, yna o dan Nifer tab, dewiswch dyddiad a dewiswch un math o ddyddiad o'r rhestr gywir yn ôl yr angen. Cliciwch OK.

doc-rownd-i-flaenorol-dydd sul-1

Nawr mae canlyniadau'r fformiwla wedi'u dangos ar ffurf dyddiad.

doc-rownd-i-flaenorol-dydd sul-1

I gael diwrnod arall o'r wythnos nesaf, defnyddiwch y fformiwlâu isod:

Yn ystod y dydd Fformiwla
Dydd Sul =IF(MOD(A2-1,7)>7,A2+7-MOD(A2-1,7)+7,A2+7-MOD(A2-1,7))
Dydd Sadwrn =IF(MOD(A2-1,7)>6,A2+6-MOD(A2-1,7)+7,A2+6-MOD(A2-1,7))
Dydd Gwener =IF(MOD(A2-1,7)>5,A2+5-MOD(A2-1,7)+7,A2+5-MOD(A2-1,7))
Dydd Iau =IF(MOD(A2-1,7)>4,A2+4-MOD(A2-1,7)+7,A2+4-MOD(A2-1,7))
Dydd Mercher =IF(MOD(A1-1,7)>3,A1+3-MOD(A1-1,7)+7,A1+3-MOD(A1-1,7))
;Dydd Mawrth =IF(MOD(A1-1,7)>2,A1+2-MOD(A1-1,7)+7,A1+2-MOD(A1-1,7))
Dydd Llun =IF(MOD(A1-1,7)>1,A1+1-MOD(A1-1,7)+7,A1+1-MOD(A1-1,7))

swigen dde glas saeth Dyddiad talgrynnu i ddiwrnod wythnos penodol blaenorol

Er enghraifft, yma i gael y dydd Sul blaenorol o'r dyddiadau yng ngholofn A

1. Dewiswch gell yr ydych am ei gosod y dyddiad Sul nesaf, yna pastiwch neu nodwch isod y fformiwla:

=A2-DIWRNOD WYTHNOS(A2,2)

2. Yna pwyswch Rhowch allweddol i gael y dydd Sul nesaf cyntaf, yna llusgo auto llenwi i lawr i gael yr holl ganlyniadau.

doc-rownd-i-flaenorol-dydd sul-1

Os ydych chi am newid y fformat dyddiad, cadwch y celloedd fformiwla a ddewiswyd, pwyswch Ctrl + 1 allweddi i arddangos y Celloedd Fformat deialog, yna o dan Nifer tab, dewiswch dyddiad a dewiswch un math o ddyddiad o'r rhestr gywir yn ôl yr angen. Cliciwch OK.

doc-rownd-i-flaenorol-dydd sul-1

Nawr mae canlyniadau'r fformiwla wedi'u dangos ar ffurf dyddiad.

doc-rownd-i-flaenorol-dydd sul-1

I gael diwrnod blaenorol arall o'r wythnos, defnyddiwch y fformiwlâu isod:

Yn ystod y dydd Fformiwla
Dydd Sul =A2-DIWRNOD WYTHNOS(A2,2)
Dydd Sadwrn =IF(WEEKDAY(A2,2)>6,A2-WEEKDAY(A2,1),A2-WEEKDAY(A2,2)-1)
Dydd Gwener =IF(WEEKDAY(A2,2)>5,A2-WEEKDAY(A2,2)+5,A2-WEEKDAY(A2,2)-2)
Dydd Iau =IF(WEEKDAY(A2,2)>4,A2-WEEKDAY(A2,2)+4,A2-WEEKDAY(A2,2)-3)
Dydd Mercher =IF(WEEKDAY(A2,2)>3,A2-WEEKDAY(A2,2)+3,A2-WEEKDAY(A2,2)-4)
;Dydd Mawrth =IF(WEEKDAY(A2,2)>2,A2-WEEKDAY(A2,2)+2,A2-WEEKDAY(A2,2)-5)
Dydd Llun =IF(WEEKDAY(A2,2)>1,A2-WEEKDAY(A2,2)+1,A2-WEEKDAY(A2,2)-6)

Cynorthwyydd Dyddiad ac Amser pwerus

Mae adroddiadau Cynorthwyydd Dyddiad ac Amser nodwedd o Kutools ar gyfer Excel, yn cefnogi amser dyddiad adio / tynnu'n hawdd, cyfrifo'r gwahaniaeth rhwng dau ddyddiad, a chyfrifo oedran yn seiliedig ar ben-blwydd.  Cliciwch am dreial am ddim!
doc-rownd-i-flaenorol-dydd sul-1
 
Kutools ar gyfer Excel: gyda mwy na 200 o ychwanegion Excel defnyddiol, yn rhad ac am ddim i geisio heb unrhyw gyfyngiad.

Offer Cynhyrchiant Swyddfa Gorau

🤖 Kutools AI Aide: Chwyldro dadansoddi data yn seiliedig ar: Cyflawniad Deallus   |  Cynhyrchu Cod  |  Creu Fformiwlâu Personol  |  Dadansoddi Data a Chynhyrchu Siartiau  |  Invoke Swyddogaethau Kutools...
Nodweddion Poblogaidd: Darganfod, Amlygu neu Adnabod Dyblygiadau   |  Dileu Rhesi Gwag   |  Cyfuno Colofnau neu Gelloedd heb Colli Data   |   Rownd heb Fformiwla ...
Super-edrych: VLookup Meini Prawf Lluosog    VLookup Gwerth Lluosog  |   VLookup Ar Draws Taflenni Lluosog   |   Edrych Niwlog ....
Rhestr gwympo Uwch: Creu Rhestr Gollwng yn Gyflym   |  Rhestr Gollwng Dibynnol   |  Rhestr Gollwng Aml-ddewis ....
Rheolwr Colofn: Ychwanegu Nifer Penodol o Golofnau  |  Symud Colofnau  |  Toglo Statws Gwelededd Colofnau Cudd  |  Cymharwch Ystodau a Cholofnau ...
Nodweddion dan Sylw: Ffocws ar y Grid   |  Golwg Dylunio   |   Bar Fformiwla Mawr    Rheolwr Llyfr Gwaith a Thaflen   |  Llyfrgell Adnoddau (Testun Auto)   |  Dewiswr Dyddiad   |  Cyfuno Taflenni Gwaith   |  Amgryptio/Dadgryptio Celloedd    Anfon E-byst trwy Restr   |  Hidlo Super   |   Hidlo Arbennig (hidlo mewn print trwm/italig/strikethrough...) ...
15 Set Offer Gorau12 Testun offer (Ychwanegu Testun, Dileu Cymeriadau,...)   |   50 + Siart Mathau (Siart Gantt,...)   |   40+ Ymarferol Fformiwlâu (Cyfrifwch oedran yn seiliedig ar ben-blwydd,...)   |   19 mewnosod offer (Mewnosod Cod QR, Mewnosod Llun o'r Llwybr,...)   |   12 Trosi offer (Rhifau i Eiriau, Trosi arian cyfred,...)   |   7 Uno a Hollti offer (Rhesi Cyfuno Uwch, Celloedd Hollt,...)   |   ... a mwy

Supercharge Eich Sgiliau Excel gyda Kutools ar gyfer Excel, a Phrofiad Effeithlonrwydd Fel Erioed Erioed. Kutools ar gyfer Excel Yn Cynnig Dros 300 o Nodweddion Uwch i Hybu Cynhyrchiant ac Arbed Amser.  Cliciwch Yma i Gael Y Nodwedd Sydd Ei Angen Y Mwyaf...

Disgrifiad


Mae Office Tab yn dod â rhyngwyneb Tabbed i Office, ac yn Gwneud Eich Gwaith yn Haws o lawer

  • Galluogi golygu a darllen tabbed yn Word, Excel, PowerPoint, Cyhoeddwr, Mynediad, Visio a Phrosiect.
  • Agor a chreu dogfennau lluosog mewn tabiau newydd o'r un ffenestr, yn hytrach nag mewn ffenestri newydd.
  • Yn cynyddu eich cynhyrchiant 50%, ac yn lleihau cannoedd o gliciau llygoden i chi bob dydd!
Comments (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I have tested this but partially incorrect result was out. Why ?
I wanted to get next Friday.

=IF(A2="","",A2+5-Mod(A2-1,7))

I have entered 11/19/2022
The result was past day 11/18/2022
This comment was minimized by the moderator on the site
Thanks for your reminder, the original formula is not enough rigorous indeed. I have updated the formulas and rewrited the tutorial, hope the new formulas can help you.
This comment was minimized by the moderator on the site
Im trying to work out how to use a date, less an amount of days but ensure when subtracting the days it lands on a weekday not a weekend.
Any formulas??
This comment was minimized by the moderator on the site
Hi Everyone,
I use the formula below to round to the next Thursday where A1 is the cell with your original date and 14 is for Thursday. You can use other numbers for other days if required. 11=Monday, 12=Tuesday, 13=Wednesday, etc...

Also, you can use a 1 instead of an 8 to get the Thursday before your original date in A1. If your original date is already a Thursday the formula will produce the same date as in A1.

I hope this helps!

=A1+(0-WEEKDAY(A1,14)+8)
This comment was minimized by the moderator on the site
Thank you! This worked :)
This comment was minimized by the moderator on the site
I put this into google sheets and to make the dates become next thursday but I have not been able to get it to work especially for the dates right after thursdays. =IF(L2="","",L2+4-MOD(L2-1,4)) is the function i used to make it thursday but not all dates were thursday.
This comment was minimized by the moderator on the site
to clarify, all dates become thursday, but friday and saturday will not convert to the next weeks thursday instead they will go back a day or two to the previous thursday instead going to next weeks thursday, is there any way to fix this in the function =IF(L4="","",L4+4-MOD(L4-1,7))
This comment was minimized by the moderator on the site
Hi Kisho,

I use the formula below to round to the next Thursday where A1 is the cell with your original date and 14 is for Thursday. You can use other numbers for other days if required. 11=Monday, 12=Tuesday, 13=Wednesday, etc...

Also, you can use a 1 instead of an 8 to get the Thursday before your original date in A1. If your original date is already a Thursday the formula will produce the same date as in A1.

I hope this helps!

=A1+(0-WEEKDAY(A1,14)+8)
This comment was minimized by the moderator on the site
Hi Kisho,
I use the formula below to round to the next Thursday where A1 is the cell with your original date and 14 is for Thursday. You can use other numbers for other days if required. 11=Monday, 12=Tuesday, 13=Wednesday, etc...
Also, you can use a 1 instead of an 8 to get the Thursday before your original date in A1. If your original date is already a Thursday the formula will produce the same date as in A1.
I hope this helps!
=A1+(0-WEEKDAY(A1,14)+8)
This comment was minimized by the moderator on the site
I put this into google sheets and to make the dates become next thursday but I have not been able to get it to work especially for the dates right after thursdays. =IF(L2="","",L2+4-MOD(L2-1,4)) is the function i used to make it thursday but not all dates were thursday.
This comment was minimized by the moderator on the site
Si quiero la fecha del próximo viernes cómo debo modificar las variables? Gracias
This comment was minimized by the moderator on the site
Sorry, I cannot understand, could you speak in English?
This comment was minimized by the moderator on the site
hi guys,

I used the formula below, I hope it works for you.
IF(WEEKDAY(H2,16)<>7,(7-WEEKDAY(H2,16))+H2,H2) where H2 is the date that you want to round up to the next day of the week (in my case for Friday) and the 16 is the format to start the date with Saturday as #1 and Friday as #7.
This comment was minimized by the moderator on the site
Your round to previous Sunday is flawed. Even shows as much on your sheet.
This comment was minimized by the moderator on the site
So, what would be the correct formula to first check to see if a cell has a date, else leave it blank and make the date the fall on a Friday before if the date falls on a Saturday or Sunday?
This comment was minimized by the moderator on the site
I found a workaround for to the previous Friday. You can change the switch "results" as needed to round to different days.=H3-SWITCH(TEXT(H3, "DDD"), "Mon", 3, "Tue", 4, "Wed", 5, "Thu", 6, "Fri", 0, "Sat", 1, "Sun", 2)
=[date]-SWITCH(TEXT([date], "DDD"), "Mon", 3, "Tue", 4, "Wed", 5, "Thu", 6, "Fri", 0, "Sat", 1, "Sun", 2)
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations