Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

column() by name not number?

I thought this would be easy to find via search, but no dice. I have a straight table/chart that uses column() references in its expressions -- e.g. Cost * column(1). I want to refer to columns not by number but by name (label). Further, many of my column names use expressions. So I might have a column label set to...

="Usage" & chr(10) & vMonth

Part of the problem is users clicking and dragging column headers around to reorder the columns (sometimes inadvertently). This throws off some of the calculations. Rewriting the expressions to not use column references isn't really an option.

Is there a way? Thanks.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

Try this in your expression :

$(='['&"Usage" & chr(10) & vMonth&']')

View solution in original post

5 Replies
sunny_talwar

The changing nature (because you use expressions for column label it seems) of the column label might make it difficult, if not impossible, to refer the label names in your expression. May be use the actual expressions or put the expression in a variable and use variable to do what you are doing with the expression labels.

swuehl
MVP
MVP

Try

="$(='Usage' & chr(10) & vMonth)"

luciancotea
Specialist
Specialist

One solution is to block the columns rearranging:

Straigt Table -> Presentation -> Allow Drag and Drop

Pivot -> Presentation -> Allow Pivoting

But usually I write expressions without referencing other columns.

Anonymous
Not applicable
Author

Hi,

Try this in your expression :

$(='['&"Usage" & chr(10) & vMonth&']')

Not applicable
Author

Excellent. Thank you.