Hello community, I've been racking my brain for a while now and need help. I'm trying to create unique transaction #'s based of the transaction date. Issue is that I need to start the transaction date over every year. I'm using Rank and Countifs functions combined to help create the Transaction ID but can't figure out how to start the numbering over for each year. Any help would be greatly appreciated.
Book1.xlsx | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | Transaction Date | ID # w/duplicates | ID # w/o duplicates | What it should look like | ||
2 | 12/15/17 | 2017-02 | 2017-02 | 2017-02 | ||
3 | 12/12/17 | 2017-01 | 2017-01 | 2017-01 | ||
4 | 12/19/17 | 2017-03 | 2017-03 | 2017-03 | ||
5 | 12/27/17 | 2017-04 | 2017-04 | 2017-04 | ||
6 | 02/09/18 | 2018-06 | 2018-06 | 2018-02 | ||
7 | 01/15/18 | 2018-05 | 2018-05 | 2018-01 | ||
8 | 03/22/18 | 2018-07 | 2018-07 | 2018-03 | ||
9 | 03/23/18 | 2018-08 | 2018-08 | 2018-04 | ||
10 | 03/23/18 | 2018-08 | 2018-09 | 2018-05 | ||
11 | 03/31/18 | 2018-010 | 2018-010 | 2018-06 | ||
12 | 09/17/18 | 2018-011 | 2018-011 | 2018-07 | ||
13 | 10/28/18 | 2018-012 | 2018-012 | 2018-08 | ||
14 | 11/03/18 | 2018-013 | 2018-013 | 2018-09 | ||
15 | 01/19/19 | 2019-014 | 2019-014 | 2019-01 | ||
16 | 02/07/19 | 2019-015 | 2019-015 | 2019-02 | ||
17 | 08/15/19 | 2019-016 | 2019-016 | 2019-03 | ||
18 | 10/04/19 | 2019-017 | 2019-017 | 2019-04 | ||
19 | 03/13/20 | 2020-018 | 2020-018 | 2020-01 | ||
20 | 03/13/20 | 2020-018 | 2020-019 | 2020-02 | ||
21 | ||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B2:B20 | B2 | =TEXT(A:A,"yyyy")&"-0"&RANK(A2,A$2:A$20,1) |
C2:C20 | C2 | =TEXT(A:A,"yyyy")&"-0"&RANK(A2,A$2:A$1000,1)+COUNTIF($A$2:A2,A2)-1 |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
A2:A20,D2:D20 | Cell | contains a blank value | text | NO |