Function to get the column name of a cell?

How to get the column name of a cell?

For example what function can I use in the cell B3 so that the return value is the column name “B”?

I found the solution

=SUBSTITUTE(ADDRESS(1;COLUMN();4);“1”;"")

in another question: How to convert a column index to a column name?

Hello,

=REGEX(ADDRESS(ROW(),COLUMN(),4),"(.+)(\d+)","$1") should work

Update According to @keme’s comment (thanks for that)

=REGEX(ADDRESS(ROW(),COLUMN(),4),"([:alpha:])(\d+)","$1") --or–
=REGEX(ADDRESS(1,COLUMN(),4),"([:alpha:])(\d+)","$1")

But anyway - solution using SUBSTITUTE() and taking into account that row isn’t important at all is much simpler.

Hope that helps

The (.+) uses greedy matching, which catches digits from row 10 onwards. Add a question mark for lazy matching. =REGEX(ADDRESS(ROW(),COLUMN(),4),"(.+?)(\d+)","$1")

thank you!