Related question:
http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_28512271.html
I have often used the COLUMN() function to get the numeric value of a column, including in this question. Is there a way to get the alpha value for a column instead? I have currently managed it with this extremely long formula:
=ADDRESS(MATCH(RIGHT(AA33,
1)*1,$Z$1:$Z$38,0),COLUMN(),1,1,RIGHT(CELL("filename",$A$1),LEN(CELL("filename",$A$1))-FIND("]",CELL("filename",$A$1),1)))&":$"&MID(ADDRESS(MATCH(RIGHT(AA34,1)*1,$Z$1:$Z$38,0),COLUMN(),1,1,RIGHT(CELL("filename",$A$1),LEN(CELL("filename",$A$1))-FIND("]",CELL("filename",$A$1),1))),FIND("$",ADDRESS(MATCH(RIGHT(AA34,1)*1,$Z$1:$Z$38,0),COLUMN(),1,1,RIGHT(CELL("filename",$A$1),LEN(CELL("filename",$A$1))-FIND("]",CELL("filename",$A$1),1))),1)+1,FIND("$",SUBSTITUTE(ADDRESS(MATCH(RIGHT(AA34,1)*1,$Z$1:$Z$38,0),COLUMN(),1,1,RIGHT(CELL("filename",$A$1),LEN(CELL("filename",$A$1))-FIND("]",CELL("filename",$A$1),1))),"$","",1),1)-FIND("$",ADDRESS(MATCH(RIGHT(AA34,1)*1,$Z$1:$Z$38,0),COLUMN(),1,1,RIGHT(CELL("filename",$A$1),LEN(CELL("filename",$A$1))-FIND("]",CELL("filename",$A$1),1))),1))&"$"&MATCH(RIGHT(AA33,1)+1,$Z$1:$Z$38,0)-1
This generates a cell range address:
'Charge Lines'!$AB$2:$AB$16
The ADDRESS function provides the first section up to the colon and is then repeated within the following section to generate the same text from which to extract the value.
The section in bold gives the alpha value for the column.
CELL("filename",$A$1) ensures the sheet name stays correct within the ADDRESS function
FIND "$" gives position of first $ within the address, the first occurence being just before the column reference so +1 for start position for MID function
SUBSTITUTE removes the first $ and then FIND gives position of second $ within the ADDRESS
Second $ less first $ gives length of column reference for number of characters in MID function.
Row numbers for ADDRESS function and then after the above extraction of column reference are achieved by using MATCH to find a week number in a different column.
Hope that explains how the above is working.
Any suggestions for making simpler. The file is Macro Enabled so would consider use of a User Defined Function.
Example file attached with cells highlighted.
Thanks
Rob H
Dummy-Time-bookings.xlsm