bearcub
Well-known Member
- Joined
- May 18, 2005
- Messages
- 734
- Office Version
- 365
- 2013
- 2010
- 2007
- Platform
- Windows
I have the following formula that I use to extract either "Accruals" or "Payments" from the current file name
MID(CELL("filename",'Comm_Sept 22 US Summary'!$A$1),
FIND("[",CELL("filename",'Comm_Sept 22 US Summary'!$A$1))+60,
FIND("]",CELL("filename",'Comm_Sept 22 US Summary'!$A$1))-
FIND("[",CELL("filename",'Comm_Sept 22 US Summary'!$A$1))-65)
The following month I will change the file name & the text length might change due to the current month (e.g. March - April, April - May, May - June , August - September, September - October, etc).
In other words, the file size will either expand or contract due to the processing month.
The current file name I am using is called "Compensation Summary US Oct 22 - September 22 Commission Payments".
Next month, I will change to the name to "Compensation Summary US Nov 22 - October 22 Commission Payments".
September has 9 letters and October contains 8.
When I process November for October (commissions are always processed the following month), I will have to change the 60 to 61 and 65 to 64 in the formula to be able to extract "Payments" from the File Name since October has 1 less letter than September
Is there a way of making the formula I am using dynamic so I won't have to manually update the formula each month? I am working that I might just have to settle for 3 letter month as opposed to using the full month name.
Thank you for your help in advance.
Excel Formula:
FIND("[",CELL("filename",'Comm_Sept 22 US Summary'!$A$1))+60,
FIND("]",CELL("filename",'Comm_Sept 22 US Summary'!$A$1))-
FIND("[",CELL("filename",'Comm_Sept 22 US Summary'!$A$1))-65)
Excel Formula:
The following month I will change the file name & the text length might change due to the current month (e.g. March - April, April - May, May - June , August - September, September - October, etc).
In other words, the file size will either expand or contract due to the processing month.
The current file name I am using is called "Compensation Summary US Oct 22 - September 22 Commission Payments".
Next month, I will change to the name to "Compensation Summary US Nov 22 - October 22 Commission Payments".
September has 9 letters and October contains 8.
When I process November for October (commissions are always processed the following month), I will have to change the 60 to 61 and 65 to 64 in the formula to be able to extract "Payments" from the File Name since October has 1 less letter than September
Is there a way of making the formula I am using dynamic so I won't have to manually update the formula each month? I am working that I might just have to settle for 3 letter month as opposed to using the full month name.
Thank you for your help in advance.