Excel - unusual date calculation

yoyo54321

New Member
Joined
Feb 5, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi

All help would be most appreciated.

I'm working with a product that comes with a manufacturing date code of a 2 digit year code and 2 digit week number example 2143 and i need add 52 weeks so it returns the same format 2243 but takes into account some years have a different amount of weeks.

So i need to enter the 4 digit manufacturing date and be able to enter that amount of weeks they expire because some have 52 weeks but others have 78 weeks

Column A Column B Column C
2143 x 52 = 2243
2151 x 78 =

Thanks in advance

Kev
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Welcome to the Forum.

Please provide more examples for us. I can't understand what you mean by "78 weeks."
 
Upvote 0
Welcome to the Forum.

Please provide more examples for us. I can't understand what you mean by "78 weeks."
Thanks for taking a look. We have 2 products 1 expires after 52 weeks and another after 78 weeks from the date the manufacturing. I'm struggling because they use the manufacturing date of 2 a digit year code and week number.
 
Upvote 0
Try this. Without more examples to review, I can only guess.

MrExcel posts19.xlsx
CDEFGHIJK
5old codeleftrightaddyearsyearweeknew codenew code (single cell)
621432143521224322432243
721512151782232523252325
Sheet13
Cell Formulas
RangeFormula
D6:D7D6=LEFT(C6,2)
E6:E7E6=RIGHT(C6,2)
G6:G7G6=INT((E6+F6)/52)
H6:H7H6=D6+G6
I6:I7I6=MOD(E6+F6,52)
J6:J7J6=NUMBERVALUE(H6&I6)
K6:K7K6=NUMBERVALUE(LEFT(C6,2)+INT((RIGHT(C6,2)+F6)/52)&MOD(RIGHT(C6,2)+F6,52))
 
Upvote 0
Hi,

This is a bit more complicated than I anticipated:

Book3.xlsx
ABC
1Start Date CodeAdd WeeksNew Date Code
22143522243
32151782324
Sheet987
Cell Formulas
RangeFormula
C2:C3C2=TEXT(DATE(2000+LEFT(A2,2),1,-2)-WEEKDAY(DATE(2000+LEFT(A2,2),1,3))+(RIGHT(A2,2)-1)*7+B2*7,"yy")&WEEKNUM(DATE(2000+LEFT(A2,2),1,-2)-WEEKDAY(DATE(2000+LEFT(A2,2),1,3))+(RIGHT(A2,2)-1)*7+B2*7)
 
Upvote 0
Hi. That looks like it works but i need to confirm on Monday

Thanks very much for your help
 
Upvote 0
Thank you for the clarification. See if the following formula works for you:
Excel Formula:
=TEXT(DATE(20&LEFT(A2,2),1,-2)-WEEKDAY(DATE(20&LEFT(A2,2),1,4),2)+RIGHT(A2,2)*7+B2*7,"yy")&WEEKNUM(DATE(20&LEFT(A2,2),1,-2)-WEEKDAY(DATE(20&LEFT(A2,2),1,4),2)+RIGHT(A2,2)*7+B2*7,21)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,816
Members
449,095
Latest member
m_smith_solihull

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