ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sum column based on column heading (https://www.excelbanter.com/excel-worksheet-functions/64683-sum-column-based-column-heading.html)

nockam

Sum column based on column heading
 

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


--
nockam
------------------------------------------------------------------------
nockam's Profile: http://www.excelforum.com/member.php...o&userid=15744
View this thread: http://www.excelforum.com/showthread...hreadid=500507


Govind

Sum column based on column heading
 
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.

nockam wrote:
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



Biff

Sum column based on column heading
 
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

"nockam" wrote in
message ...

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


--
nockam
------------------------------------------------------------------------
nockam's Profile:
http://www.excelforum.com/member.php...o&userid=15744
View this thread: http://www.excelforum.com/showthread...hreadid=500507




Biff

Sum column based on column heading
 
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

"Biff" wrote in message
...
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

"nockam" wrote in
message ...

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


--
nockam
------------------------------------------------------------------------
nockam's Profile:
http://www.excelforum.com/member.php...o&userid=15744
View this thread:
http://www.excelforum.com/showthread...hreadid=500507






nockam

Sum column based on column heading
 

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


--
nockam
------------------------------------------------------------------------
nockam's Profile: http://www.excelforum.com/member.php...o&userid=15744
View this thread: http://www.excelforum.com/showthread...hreadid=500507



All times are GMT +1. The time now is 07:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com