Two simultaneous increments; numerically and by month.

Bortas

New Member
Joined
May 30, 2020
Messages
9
Office Version
  1. 2013
Platform
  1. Windows
Hello there!

My organization tracks a number of different items via excel, and sorts them by number of incidents per month. I'm trying to build an variable item number, next to a column of timestamps (making use of the NOW()) function.
It might look a bit like this, as an example
5/09/2020 MAY001
5/13/2020 MAY002
5/19/2020 MAY003
5/30/2020 MAY004
6/1/2020 JUN001
6/23/2020 JUN002
7/6/2020 JUL001
7/14/2020 JUL002

I hope the above pattern helps clue my goal. In building the latter number (MAY001), I'm struggling on two fronts. First of all, the incrementation:

=TEXT(NOW(),"mmm") & "001"

I need to figure out how to change & "001" into a formula that increments on each new row. Then, that increment must reset again at the end/beginning of the month, and a new prefix substituted in.

Any ideas on how to proceed? Thanks for any assistance!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Brilliant! there is some nesting that's happening that I don't understand, but its working very well!

I've noted that if the user inadvertantly deletes a cell in the A column, ie A6, then all cells beyond become broken. I suspect that is centered right here: MONTH($A$2:A2) Is there a way to restate that function so that it is more resilient to empty data?

Thanks for your assistance!
 
Upvote 0
Not sure if this is what you want. If someone deletes a cell in column A then it will return a blank in column B.

Book1
AB
1DateNumber
25/9/2020May001
3 
45/19/2020May002
55/30/2020May003
6 
76/23/2020Jun001
87/6/2020Jul001
97/14/2020Jul002
107/20/2020Jul003
Sheet3
Cell Formulas
RangeFormula
B2:B10B2=IF(A2="","",TEXT(A2,"mmm")&TEXT(SUMPRODUCT(--(MONTH($A$2:A2)=MONTH(A2))),"000"))
 
Upvote 0
There it is! I kept writing almost that exact formula and getting it wrong - thank you for the assist!
 
Upvote 0
You're welcome. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,818
Members
449,049
Latest member
cybersurfer5000

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