[Excel Tables] Structured Refs - Column vs Rows

%3CLINGO-SUB%20id%3D%22lingo-sub-1975428%22%20slang%3D%22en-US%22%3E%5BExcel%20Tables%5D%20Structured%20Refs%20-%20Column%20vs%20Rows%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1975428%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20everyone!%3C%2FP%3E%3CP%3EI'm%20trying%20optimize%20a%20few%20excel%20files%20for%20work%20and%20started%20using%20more%20actively%20the%20Excel%20Table%20to%20ensure%20maximum%20automatization%3CBR%20%2F%3EI%20was%20just%20wondering%20what's%20the%20difference%20between%20referencing%20a%20column%20or%20a%20specific%20row%20in%20a%20table%20formula%20as%20it%20appears%20that%20the%20column%20reference%20always%20take%20the%20row%20it%20is%20in%3CBR%20%2F%3ELet's%20take%20a%20simply%20example%20working%20within%20a%20table.%20I%20want%20to%20multiply%20Column%20A%20of%20the%20table%20by%20a%20given%20cell%20(say%20Q1)%3CBR%20%2F%3EMy%20formula%20would%20be%3CBR%20%2F%3E%3D%24Q%241*%5BColumn%20A%5D%3C%2FP%3E%3CP%3EThis%20formula%20would%20copy%20down%20automatically%20until%20the%20end%20of%20the%20table.%20However%2C%20the%20structured%20reference%20%5BColumn%20A%5D%20will%20always%20take%20the%20row%20that%20the%20formula%20is%20typed%20in.%20So%20If%20I'm%20on%20row%202%2C%20the%20formula%20will%20evaluate%20to%20%3D%24Q%241*A2%20and%20if%20I'm%20on%20row%2055%2C%20the%20formula%20will%20evaluate%20to%20%3D%24Q%241*A55%3C%2FP%3E%3CP%3ESo%20what%20exactly%20is%20the%20difference%20with%3CBR%20%2F%3E%3D%24Q%241*%5B%40%5BColumn%20A%5D%5D%3C%2FP%3E%3CP%3EIn%20practice%20both%20formula%20evaluate%20to%20exactly%20the%20same.%3C%2FP%3E%3CP%3EI'm%20asking%20because%20when%20doing%20more%20complex%20formula%20I%20have%20a%20doubt%20whether%20it%20is%20necessary%20to%20specify%20the%20row%20or%20not.%20For%20example%20if%20I%20write%3C%2FP%3E%3CP%3E%3D%24A1%2Fsum(%5BColumn%20A%5D)%3CBR%20%2F%3Elike%3C%2FP%3E%3CP%3E%5BColumn%20A%5D%20%2F%20sum(%5BColumn%20A%5D)%20--%26gt%3B%20I%20feel%20it%20might%20get%20the%20wrong%20answer%20so%20I%20always%20write%20it%3C%2FP%3E%3CP%3E%5B%40%5BColumn%20A%5D%5D%20%2F%20sum(%5BColumn%20A%5D)%3C%2FP%3E%3CP%3EI%20hope%20this%20is%20understandable.%20Put%20simply%20-%20I%20don't%20understand%20how%20the%20%40Row%20and%20%5BColumn%5D%20are%20different%3C%2FP%3E%3CP%3EThanks%20already%20to%20all%20for%20your%20help!%3CBR%20%2F%3EBest%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1975428%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1976882%22%20slang%3D%22en-US%22%3ERe%3A%20%5BExcel%20Tables%5D%20Structured%20Refs%20-%20Column%20vs%20Rows%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1976882%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F897339%22%20target%3D%22_blank%22%3E%40Zacross%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20depends%20on%20which%20version%20of%20Excel%20you%20are.%3C%2FP%3E%0A%3CP%3E%3D%3CSPAN%3E%24Q%241*%5BColumn%20A%5D%20returns%20an%20array%20where%20entire%20column%20A%20is%20multiplied%20on%20Q1.%26nbsp%3B%3C%2FSPAN%3EIf%20Excel%20doesn't%20support%20dynamic%20arrays%2C%20it%20silently%20do%20implicit%20intersection%20and%20returns%20only%20one%20element%20of%20this%20array%20for%20the%20current%20row.%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIf%20Excel%20supports%20dynamic%20arrays%2C%20above%20doesn't%20work%20and%20you%20will%20have%20SPILL%20error%20since%20Excel%20tries%20to%20return%20entire%20array%20and%20have%20no%20room%20for%20it%20in%20one%20cell.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThus%20correct%20will%20be%26nbsp%3B%3D%24Q%241*%5B%40%5BColumn%20A%5D%5D%20which%20multiplies%20Q1%20on%20the%20value%20in%20column%20A%20from%20current%20row%20and%20return%20that%20single%20value%20into%20the%20cell.%20Such%20explicit%20notation%20works%20in%20both%20versions.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ETo%20work%20with%20aggregation%20you%20may%20add%20Total%20row%20to%20table%2C%20buy%20default%20it%20aggregates%20the%20column%20as%26nbsp%3B%3DSUBTOTAL(109%2C%5BColumn%20A%5D)%20(i.e.%20sum%20of%20all%20not-filtered%20values%20of%20Column%20A)%2C%20but%20you%20may%20use%20any%20other%20formula.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWith%20that%20in%20each%20row%20percent%20to%20sum%20will%20be%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3D%5B%40%5BColumn%20A%5D%5D%2FTable1%5B%5B%23Totals%5D%2C%5BColumn%20A%5D%5D%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
New Contributor

Hello everyone!

I'm trying optimize a few excel files for work and started using more actively the Excel Table to ensure maximum automatization
I was just wondering what's the difference between referencing a column or a specific row in a table formula as it appears that the column reference always take the row it is in
Let's take a simply example working within a table. I want to multiply Column A of the table by a given cell (say Q1)
My formula would be
=$Q$1*[Column A]

This formula would copy down automatically until the end of the table. However, the structured reference [Column A] will always take the row that the formula is typed in. So If I'm on row 2, the formula will evaluate to =$Q$1*A2 and if I'm on row 55, the formula will evaluate to =$Q$1*A55

So what exactly is the difference with
=$Q$1*[@[Column A]]

In practice both formula evaluate to exactly the same.

I'm asking because when doing more complex formula I have a doubt whether it is necessary to specify the row or not. For example if I write

=$A1/sum([Column A])
like

[Column A] / sum([Column A]) --> I feel it might get the wrong answer so I always write it

[@[Column A]] / sum([Column A])

I hope this is understandable. Put simply - I don't understand how the @Row and [Column] are different

Thanks already to all for your help!
Best

3 Replies

@Zacross 

It depends on which version of Excel you are.

=$Q$1*[Column A] returns an array where entire column A is multiplied on Q1. If Excel doesn't support dynamic arrays, it silently do implicit intersection and returns only one element of this array for the current row.

If Excel supports dynamic arrays, above doesn't work and you will have SPILL error since Excel tries to return entire array and have no room for it in one cell.

Thus correct will be =$Q$1*[@[Column A]] which multiplies Q1 on the value in column A from current row and return that single value into the cell. Such explicit notation works in both versions.

 

To work with aggregation you may add Total row to table, buy default it aggregates the column as =SUBTOTAL(109,[Column A]) (i.e. sum of all not-filtered values of Column A), but you may use any other formula.

With that in each row percent to sum will be

=[@[Column A]]/Table1[[#Totals],[Column A]]

@Sergei Baklan 

Hello Sergei and thanks for your answer!

 

Unless I'm mistaken, I'm on Office 365

Based on your answer it looks like it behaves like your initially mentions : it silently do implicit intersection and returns only one element of this array for the current row

 

In practice it doesn't mess up my calculations, but I agree that the correct synthax would be [@Column A]

 

I'll take care about this in the future! But your answer was really clear - Thanks again!

 

@Zacross , you are welcome, good luck with Tables.