Day Month Year???

carlzoll

Board Regular
Joined
Oct 22, 2004
Messages
65
I am trying to make my spreadsheet autonumber my orders by date. My autonumber format needs to be for example:
todays date is: 1/20/05

I want to have my number read: 050120

How do I do this?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Try formatting the cell as Custom: yymmdd
 
Upvote 0
I tried that but this number will be used as an autonumbered cell.

My full number looks like this: 050120-CZ1 and if I make another purchase order the number would be 050120-CZ2 and so on. But I would like to have this done in a formula rather than formating a cell.

Can anyone help?
 
Upvote 0
Can you be a bit more descriptive on the rules for your autonumber? Is it going to restart at zero for every single day?

Providing some real example of exactly how you want it to work might be helpful.
 
Upvote 0
How is a new row added? Is there some event that triggers it automatically, or do you just want the value to pop-up when someone enters something on that row?
 
Upvote 0
The number will be triggered by a button "Process PO". I have a calculation page (worksheet) that I can use to store a counter. I'm just not sure how to do this with code.
 
Upvote 0
Here is an Excel formula that does what I think you want:

=IF(LEFT(A1,6)=TEXT(NOW(),"yymmdd"),TEXT(NOW(),"yymmdd")&"CZ"&MID(A1,9,LEN(A1)-8)+1,TEXT(NOW(),"yymmdd")&"CZ1")

This assumes that you have a value in A1, and this formula is being entered into cell A2. Adjust accordingly.

Basically, what this does is look at the value in the cell above it. If today is the same date as the cell above, it will add one to the counter at the end of the counter. Otherwise, it will start over at 1 again. So the result would look something like this:

A1: 050119CZ1
A2: 050120CZ1
A3: 050120CZ2
...
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,538
Members
449,038
Latest member
Guest1337

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