+ Reply to Thread
Results 1 to 5 of 5

How to SUM data wiht the common header?

Hybrid View

  1. #1
    Registered User
    Join Date
    07-31-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    17

    How to SUM data wiht the common header?

    I have attached the excel sheet here for reference.

    I would like to sum up the values across rows, so long as they have the terms "FQ1", "FQ2", "FQ3" or "FQ4" in the first row.

    In other words, for the row "Total Revenue", I would like to sum up the quarterly values, using VBA, since the number of quarters increase with time.

    How should I code up a VBA for that?

    Thank you for the advice (:
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to SUM data wiht the common header?

    I know you said you wanted VBA for this, but this formula will also give you what you want...
    =SUMIF($B$1:$E$1,"FQ*",B10:E10)

    I used it on row 10 with data that I entered there. You could add a blank helper column just before your total column, then, when you need to extend your table, insert new columns before the blank column - but include the blank column in the formula
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    07-31-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: How to SUM data wiht the common header?

    Hi Ford!! OMG, IT WORKS!!! Thank you sooooo much!!!! It's brilliant!! And yes I do not need VBA with your formula!! Yay! (: (: (:
    Last edited by lch93lily; 08-03-2014 at 10:46 PM.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to SUM data wiht the common header?

    hehe Im glad we got you were you wanted, and thanks for the feedback

  5. #5
    Registered User
    Join Date
    07-31-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: How to SUM data wiht the common header?

    Thank you so much for helping Ford!!! You totally made my week Cheerio!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Index for a row only on cells wiht a specific header
    By Sparkplug90 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-06-2013, 08:46 PM
  2. VBA macro to hide/unhide columns wiht no data
    By VBAbeginner2010 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-15-2010, 07:21 AM
  3. Replies: 5
    Last Post: 10-15-2009, 11:12 AM
  4. VBA to plot graph wiht variable range of data
    By Kok Yong Lee in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-12-2006, 05:00 AM
  5. [SOLVED] Common header/footer in Excel
    By James in forum Excel General
    Replies: 1
    Last Post: 12-20-2005, 06:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1