Home > Mobile >  How to refer table column by column heading/name in google sheet
How to refer table column by column heading/name in google sheet

Time:01-19

(I might have used wrong terminology to frame question, and it would be great to be pointed at right question/answer.)

As shown in image I have a table. I want to sum all the values in "col2"

One way to do this is

=sum(B2:B4)

But I think a cleaner way to do this would involve somehow referring the column name in the formula, so that formula is more readable.

Is there a way to do it?

enter image description here

CodePudding user response:

Try this formula:

=SUM(INDIRECT("C"&MATCH("col2", 1:1, 0),FALSE))

Output:

enter image description here

References:

  • enter image description here

  •  Tags:  
  • Related