I have a spreadsheet with States as rows. For each State, there are 4
columns of data for Year 1, then 4 more columns of data for Year 2,
and so on. Each column represents a quarter for that year.

For example:

Column A lists the State
---
Column B data for 1st quarter, 2000
Column C data for 2nd quarter, 2000
Column D data for 3rd quarter, 2000
Column E data for 4th quarter, 2000
---
Column F data for 1st quarter, 2001
Column G data for 2nd quarter, 2001
Column H data for 3rd quarter, 2001
Column I data for 4th quarter, 2001
---
etc.

I would like to write a macro that, for each year:

- sums the 1st and 2nd quarter and replaces the two columns with one
column holding the sum
- sums the data for the 3rd and 4th quarter, and replaces the two
columns with one column holding the sum

Resulting in:

Column A lists the State
---
Column B data for 1st+2nd quarter, 2000
Column C data for 3rd+4th quarter, 2000
---
Column D data for 1st+2nd quarter, 2000
Column E data for 3rd+4th quarter, 2000
---
etc.

Any suggestions about how to go about tackling this?

Thank you.

      2003                        2004
State CountA CountB CountC CountD CountA CountB CountC CountD



And so on for many year

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to