Re-formatting x-axis months to generic "month 1, month 2, month 3" etc.

heretol3arn

New Member
Joined
Aug 23, 2021
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi All -

I've got an issue that I'm trying to resolve, but have been unable to so-far. I am trying to reformat the x-axis values (which are currently in months) to a more generic label. I would like Oct-2021 to be "Month 1" and so on and so forth, so until "Month 33" for Jun-2024.

I've created a stacked horizontal bar below and unfilled the values prior to the start date to build out a Gantt chart. Also, I've tried formatting through custom formats, but I haven't had any luck so far.

1629740780974.png


Does anyone have any ideas on how to get to the desired result?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Create a helper column, fill it with month 1, 2, 3 etc. and use it as x axis if you don't care much about precise date positioning.
If not - fill it with decimal numbers to account for the exct date and use custom number format on x axis afterwards.
 
Upvote 0
With a dynamic formula, or just put 1,2,3...and fill down


asdfadf.xlsm
AB
11-oktMonth 1
21-novMonth 2
31-decMonth 3
41-janMonth 4
51-febMonth 5
61-mrtMonth 6
71-aprMonth 7
81-meiMonth 8
91-junMonth 9
101-julMonth 10
111-augMonth 11
121-sepMonth 12
131-oktMonth 13
141-novMonth 14
151-decMonth 15
161-janMonth 16
171-febMonth 17
181-mrtMonth 18
191-aprMonth 19
201-meiMonth 20
211-junMonth 21
221-julMonth 22
231-augMonth 23
241-sepMonth 24
251-oktMonth 25
261-novMonth 26
271-decMonth 27
281-janMonth 28
291-febMonth 29
301-mrtMonth 30
311-aprMonth 31
321-meiMonth 32
331-junMonth 33
Blad1
Cell Formulas
RangeFormula
B1:B33B1="Month "&COUNTA($A$1:$A$33)-(DATEDIF(A1,$A$33,"m"))
 
Upvote 0
Create a helper column, fill it with month 1, 2, 3 etc. and use it as x axis if you don't care much about precise date positioning.
If not - fill it with decimal numbers to account for the exct date and use custom number format on x axis afterwards.
So I'm not entirely sure what you mean by this. I've added a helper column and set up the series, however it doesn't recognize it as a point on the x-axis but rather just as "Jan-00"
1629742371828.png
 
Upvote 0
With a dynamic formula, or just put 1,2,3...and fill down


asdfadf.xlsm
AB
11-oktMonth 1
21-novMonth 2
31-decMonth 3
41-janMonth 4
51-febMonth 5
61-mrtMonth 6
71-aprMonth 7
81-meiMonth 8
91-junMonth 9
101-julMonth 10
111-augMonth 11
121-sepMonth 12
131-oktMonth 13
141-novMonth 14
151-decMonth 15
161-janMonth 16
171-febMonth 17
181-mrtMonth 18
191-aprMonth 19
201-meiMonth 20
211-junMonth 21
221-julMonth 22
231-augMonth 23
241-sepMonth 24
251-oktMonth 25
261-novMonth 26
271-decMonth 27
281-janMonth 28
291-febMonth 29
301-mrtMonth 30
311-aprMonth 31
321-meiMonth 32
331-junMonth 33
Blad1
Cell Formulas
RangeFormula
B1:B33B1="Month "&COUNTA($A$1:$A$33)-(DATEDIF(A1,$A$33,"m"))
Hi JEC - Thank you for your response, in terms of converting the month into "Month 1" that is not the issue. I am trying to get the x-axis on the graph to show Month 1, Month 2, Month 3 instead of "Oct-21" etc.
 
Upvote 0
export vba.xlsx
CDEFGH
5start =01.01.2022
6
7TasksstartlengthcompletionDurationStart Month
8task 115.01.20223 months15.04.202290month 1
9task 201.01.20222 months01.03.202259month 1
10task 301.02.20224 months01.06.2022120month 2
11task 418.04.20229 months18.01.2023275month 4
12task 519.06.202212 months19.06.2023365month 6
13task 627.09.20228 months27.05.2023242month 9
14task 706.12.202210 months06.10.2023304month 12
15task 804.02.20236 months04.08.2023181month 14
16task 920.05.20235 months20.10.2023153month 17
17task 1016.11.20237 months16.06.2024213month 23
18task 1127.09.20233 months27.12.202391month 21
19task 1225.01.20242 months25.03.202460month 25
Sheet2
Cell Formulas
RangeFormula
F8:F19F8=EDATE(D8,E8)
G8:G19G8=F8-D8
H8:H19H8=DATEDIF($E$5,D8,"m")+1
D12D12=D11+62
D13:D19D13=D12+A13

columns E and H are numbers with custom number format

1629746957918.png
 
Upvote 0
BTW, keep in mind the axis are swaped in this type of chart.
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,027
Members
452,374
Latest member
keccles

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