VBA/formula to show w/c date, month, quarter and year across all columns

halesowenmum

Active Member
Joined
Oct 20, 2010
Messages
383
Office Version
  1. 365
Platform
  1. Windows
So I 've got a Gantt with lots of narrow little columns each of which have the date in UK short date format on that row (row 22) so that just the date shows eg '6' for the 6th of March 2019 say
Row above that one (21) references the date in row 22 but is formatted to appear as "W/c Mon 05"
Row above that one (20) references the date in row 22 but is formatted to appear as "March"
Row above that one (19) references the date in row 22 but is formatted to appear as the Quarter using the formula: [FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]="Q"&ROUNDUP(MONTH(K21)/4,0) - which isn't working - I used 3 in it and it didn't work right and have tried 4 which works ok for some but then goes wrong again for others
Row above that one (18) references the date in row 22 but is formatted to appear as "2019"

My dates on their own as dates in row 22 were filled right using a formula which leaves out weekends and using a named range also excludes bank holidays so some months may have five weeks, some may have four.

I'm going to be releasing this to people for a project which may take 12 months to complete, it may take 24... trying to manage the copy pasting of this and using merged cells and taking into account the issues caused by bank holiday weekends, how can I have all of these things generated 'automatically' across the columns to which they relate eg for the quarters just as an example, I want it to group itself into a merged cell that reflects the correct days, weeks and months below and won't extend too far into other columns because there's a bank holiday. Apologies, I've no idea what this is called or how it's best achieved I just am already struggling to try and copy paste and having to stop to keep checking the w/c Mondays are right and so on - I know there's a way to do this but I'm afraid it's beyond me to know even how to start.

Can anyone help?? Happy to try a VBA or formula solution. [/FONT]
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I may have found the formula I used previously but my knowledge is so limited I can't recognise if it is what I used or not:
=IF(OR(LEFT(M2,3)= "Jan",LEFT(M2,3)="Feb",LEFT(M2,3)="Mar"),"Apr "&RIGHT(M2,4)-1&" - Mar "&RIGHT(M2,4),"Apr "&RIGHT(M2,4)&" - Mar "&RIGHT(M2,4)+1)

If this looks like it's what I've described in the OP, can you tell me how I use it (!!)?

I've pasted it into my spreadsheet but it's not working and I'm not clear where it needs to go or what it should reference....
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,212
Members
452,618
Latest member
Tam84

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