Sum column based on column heading

N

nockam

I have a sheet where i export in data that has to have text to columns
ran on it in order to get it out of a single cell. From there I need to
find the column with the heading "column ex" Then add "column ex" The
problem is "column ex" is not always in the same column, somtimes its
column B, or C, or D all the way up to X. Does anyone have any
suggestions? I have been trying this now for an hour with several
differnet ways but so far i havent had any luck. Thanks Garrett
 
G

Govind

Hi,

Try using this formula

=SUM(OFFSET(A1,1,MATCH("column ex",$A$1:$H$1)-1,1000))

where A1:H1 is where you have the column headers and 1000 at the end of
the formula represents number of rows you have to sum. If you have more
than 1000 rows to sum, you can change it to the actual number of rows.

Regards

Govind.
 
B

Biff

Hi!

One way:

Assumptions:

Row 1 is the header row
Values to sum are in row 2 to row 10

=SUM(OFFSET(A1,1,MATCH("column ex",1:1,0)-1,ROWS(A2:A10)))

Biff
 
B

Biff

An even better way:

Assume your data (including headers) is in row 1 to row 10:

=SUM(INDEX(1:10,,MATCH("column ex",1:1,0)))

Biff
 
N

nockam

That did the trick! Thanks to both of you for your help. I would have
been up working a lot longer tonight if you two didn't come along and
save me! Thanks, Garrett
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top