[VBA] Pivot Table make column headers show Day 12 instead of xx/xx/xxxx

ZombieHairdu

New Member
Joined
Oct 1, 2019
Messages
4
I wasn't exactly sure how to word the title outside of providing the actual problem itself.

I have a pivot table that has a dynamic amount of informaiton. My current pivot table has 27 unique dates, the next one I run could have 30 or even < 20.

The column header we use is the Received Date and it is in the format of xx/xx/xxxx but I want it to produce an actual Day 1 if it was today, Day 2 if it was 1 days ago etc.

I currently use a formula within the macro that uses a nested IF statement to do
Code:
=IF(RC[-1]=TODAY()-13, ""Day 13"", IF(RC[-1]=TODAY()-14, ""Day 14"", RC[-1]))

However I am not sure if it is best practice to just continue the nested statement or is that my best bet?
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi there. This will produce the result you want i think:

Code:
=""Day ""&(TODAY()-RC[-1]+1)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,520
Messages
6,114,099
Members
448,548
Latest member
harryls

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