LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default locate a column, sum specific columns to the right of that col

Here's my response as posted in your other, later thread (believe you were
still to resolve the same issues that you posted here) ...
--------------

Let's say you have col data in groups of 3 cols, with headers in row2 (eg:
Period1, Period2, etc), where each header is placed only in the leftmost cell
for the group, eg:

Period1 Period2
9 88 76 6 99 11
1 22 44 5 88 23
etc

To sum the col data corresponding to a specific header (eg: Period1),
you could use* these triplets:
=SUM(OFFSET(A:A,,MATCH("Period1",2:2,0)-1))
=SUM(OFFSET(A:A,,MATCH("Period1",2:2,0)))
=SUM(OFFSET(A:A,,MATCH("Period1",2:2,0)+1))
*placed to avoid circular ref errors, of course

The 1st will return the leftmost col's sum for Period1's group, the 2nd
returns the middle col's sum, and the 3rd returns the rightmost col's sum.
All 3 expressions are similar, where we adjust the OFFSET's col param
returned by the MATCH (that's the: +1,-1 bits) to suit the particular col to
"grab" for the sum. Instead of hardcoding "Period1" in the expressions, you
could of course point to another cell/DV returning the col header for
flexibility. Useful? thump the YES below

--
Max
Singapore
---
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
locate cell with specific text and select that column rockytopfan4ever Excel Discussion (Misc queries) 3 July 30th 08 01:53 PM
Locate last cell in column Sloth Excel Discussion (Misc queries) 8 January 24th 08 05:36 PM
Locate a specific row or column clara New Users to Excel 2 March 22nd 07 04:45 PM
How to add one column if 2 other columns have a specific value jettp Excel Worksheet Functions 2 January 27th 06 06:55 PM
Counting unique entries in column A but only if specific values appear in columns B and C markx Excel Worksheet Functions 1 February 10th 05 11:52 AM


All times are GMT +1. The time now is 12:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"