LOT number generator - date and static text

feelkg211

New Member
Joined
Apr 12, 2017
Messages
30
[FONT=&quot]I have an if statement =IF(D2="","",TODAY()+2) but I wanna change it so if D2 is a nonzero, the cell will produce a lot number with a format of mmddy202P.[/FONT]
[FONT=&quot]202P is a standard ending for the LOT Numbers. I was also hoping that the year will only have one digit (end of the year digit: 2017 =7).[/FONT]
[FONT=&quot]So for example I input something in D2 today (9/26/2017), the LOT number Generated will be 09287202P.[/FONT]
[FONT=&quot]Cell formatting only allows mmddyy.[/FONT]
[FONT=&quot]Any suggestions?[/FONT]
 

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.
There is probably a better way but this should work:
Excel Workbook
DE
1DateLot#
29/26/201709287202P
310/2/201710047202P
Sheet
 
Upvote 0
Hi,

The 2 days should be added before you look at month number, otherwise it will not switch to next mont if used like on Sept 30th...

Apart from the 1 digit year you can do this directly with the TEXT formula (attention the codes depend on your PCs regional settings, these are the English codes...)

TEXT(D2+2,"mmdd")&RIGHT(YEAR(D2+1))&"202P"
 
Upvote 0
If you add 2 days to Thursday it becomes Sat., so would you want it to move to Monday, and 2 days added to Fri. is Sun. so should that become Tues.?
What if cell D2 has a Sat. or Sun. date then what?

If D2 will not have a Sat. or Sun. date then try this slight change to the formula from istiasztalos.

Code:
=TEXT(WORKDAY(D2,2),"mmdd")&RIGHT(YEAR(D2),1)&"202P"
 
Upvote 0
If Fri should move to Tues. formula in E2.
If Fri should move to Monday then formula in F2.
Excel Workbook
DEF
1If Fri should move to Tues.If Fri should move to Mon
2Monday, September 4, 201709067202P09067202P
3Wednesday, September 6, 201709087202P09087202P
4Friday, September 8, 201709127202P09117202P
Sheet
 
Upvote 0

Forum statistics

Threads
1,213,562
Messages
6,114,326
Members
448,564
Latest member
ED38

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