Oct 29 2021 01:11 PM - edited Oct 29 2021 01:12 PM
I am working on trying to get an output for training classes. Based on the date they start training I want to automatically populate which week of training they are in. I am including weekends (or open to other thoughts)
I have a date in cell N4, I want cell O4 to display "1" if <= 7 days, "2" if between 7 and 13, "3" if between 14 and 21, "4" if between 22 - 29, anything greater "graduated"
Oct 29 2021 01:43 PM
=IF(TODAY()-N4<=7,1,IF(AND(TODAY()-N4>=7,TODAY()-N4<=13),2,IF(AND(TODAY()-N4>=14,TODAY()-N4<=21),3,IF(AND(TODAY()-N4>=22,TODAY()-N4<=29),4,"graduated"))))
Is this the formula you are looking for?
Oct 29 2021 01:46 PM
Oct 29 2021 01:49 PM
The formula i sent you originally was wrong, sorry. I meanwhile sent you the corrected formula.
Oct 29 2021 01:51 PM
Oct 29 2021 01:52 PM - edited Oct 29 2021 01:53 PM
Here are two other variations:
=IF(INT((N4-M4)/7)<4,INT((N4-M4)/7)+1,"Graduated")
Or if you have an "Up-To-Date" Microsoft (Office) 365 subscription, a slightly faster version would be:
=LET(WeekDiff,INT((N4-M4)/7),
IF(WeekDiff<4,WeekDiff+1,"Graduated")
)
I'm making the assumption that your 22-29 was really intended to be 22-28.
Oct 29 2021 01:53 PM
Solution=IF(TODAY()-N4<=7,1,IF(AND(TODAY()-N4>=7,TODAY()-N4<=13),2,IF(AND(TODAY()-N4>=14,TODAY()-N4<=21),3,IF(AND(TODAY()-N4>=22,TODAY()-N4<=29),4,"graduated"))))
I sent it a few minutes ago. Here it is again.
Oct 29 2021 01:55 PM
Oct 29 2021 01:58 PM
As a comment, the best way to exchange formulae is to share simple sample Excel file without sensitive content. Screenshots and like are not very useful and not very informative. Formulae could be duplicated (and better if they are) in the post to illustrate the discussion, but they could be for different locale, could include wrong (for formulae) HTML symbols, etc. Excel file converts everything automatically, thus you are locale independent.
Oct 29 2021 01:59 PM
Oct 29 2021 02:01 PM
Oct 29 2021 02:03 PM
=IF(N4-M4<=7,1,IF(AND(N4-M4>=7,N4-M4<=13),2,IF(AND(N4-M4>=14,N4-M4<=21),3,IF(AND(N4-M4>=22,N4-M4<=29),4,"graduated"))))
Please try this formula. I assumed that you wanted to compare date of column N with date of today.
Oct 29 2021 02:14 PM
That's only a comment for future. Recommendations are here Welcome to your Excel discussion space! - Microsoft Tech Community. File is on the first place, screenshot and other supporting content is always welcome.
Oct 29 2021 02:16 PM
Oct 29 2021 02:44 PM - edited Oct 29 2021 02:48 PM
Try this to address the Blank Cells and Not happened yet situations:
=LET(WeekDiff,ROUNDUP((TODAY()-N4)/7,0),
IF(ISBLANK(N4),"",
IF(WeekDiff<=0,0,
IF(WeekDiff<=4,WeekDiff,"Graduated")))
)
To refence cell M4 instead of tod, just change "Today()" to M4 Like this:
=LET(WeekDiff,ROUNDUP((M4-N4)/7,0),
Oct 29 2021 01:53 PM
Solution=IF(TODAY()-N4<=7,1,IF(AND(TODAY()-N4>=7,TODAY()-N4<=13),2,IF(AND(TODAY()-N4>=14,TODAY()-N4<=21),3,IF(AND(TODAY()-N4>=22,TODAY()-N4<=29),4,"graduated"))))
I sent it a few minutes ago. Here it is again.