How can I change my excel formula if I need to replace direct reference to the cell by the column name of this cell? For example, instead of
SUM(A1:B1)
I want to use something like
SUM({Column1}:{Column2})
I know about structured reference, but I can not convert my excel dataset into named table. Do I have any options?
This answer assumes that the column name
is the content of the header row for that column.
Say we have data like:
and we want to sum part of the row based on certain months, say between Feb and Jun. In B6 enter Feb and in C6 enter Jun and in D6 enter:
=SUM(INDEX(A2:L2,MATCH(B6,A1:L1,0)):INDEX(A2:L2,MATCH(C6,A1:L1,0)))
So by changing B6 and C6 we can change the part of the second row we are summing.
EDIT#1:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.