We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Excel Formula help

Options
foxystoat69
foxystoat69 Posts: 367 Forumite
edited 11 May 2011 at 4:07PM in Techie Stuff
Hi there guys, using Excel 2010 here....

http://i130.photobucket.com/albums/p275/foxystoat/Excel.jpg

If I had varying amounts of data (see picture in above link - tried to paste image direct to this page but website wouldn't let me) and wanted to put in sub totals of each group of data (as per the red boxes), what way can I best do this? Obviously, I can't copy the formula and paste all the way down my very lengthy spreadsheet.

Any quick fixes to sort this out?

Cheers

Comments

  • Dave_C_2
    Dave_C_2 Posts: 1,827 Forumite
    Sorry but your link doesn't work:(

    Dave
  • foxystoat69
    foxystoat69 Posts: 367 Forumite
    Dave_C wrote: »
    Sorry but your link doesn't work:(

    Dave
    Ach! Thanks Dave

    Link should read http://i130.photobucket.com/albums/p275/foxystoat/Excel.jpg
  • HoofeHearted
    HoofeHearted Posts: 2,652 Forumite
    Part of the Furniture 1,000 Posts Photogenic
    edited 11 May 2011 at 4:08PM
    Use Excel Help and read up on "Pivot Tables".
  • apcorbett
    apcorbett Posts: 161 Forumite
    or use:

    =SUBTOTAL(9,A1 : A3) NB Remove the spaces between A1 and : and A3 to make it work)

    will give you the SUM of the cells shown (A1 to A3) - simply substitute the cells you really want, and Bob is indeed your uncle!

    :money:
    Andy Corbett

  • Stompa
    Stompa Posts: 8,375 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    There's probably a better solution, but one way would be as follows: [which assumes your numbers are in column A starting at A1, and requires the addition of a 'helper' column (B)]

    Remove the spaces arround the ':'

    Into cell B1 put

    =COUNTBLANK(A$1 : A1)

    copy this value into the rest of column B.

    In the cells where you want the first sum to appear in column C put:

    =SUMIF(B:B,B1,A : A)

    (adjust B1 to be one row above the cell you're using in column C)

    Now just copy and paste this into the rest of the cells in column C where you want the sum to appear.
    Stompa
  • foxystoat69
    foxystoat69 Posts: 367 Forumite
    Thanks, have been shown another way. Works best for me

    Column A : Insert your figures complete with gaps
    Column B : =IF(A2>0,1,0)
    Column C : =IF(B2=1,A2+C1,0)
    Column D : =IF(A2="",C1,"")

    Hide Columns B & C and copy formulae down.
  • Stompa
    Stompa Posts: 8,375 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    Actually thinking about it, you can do it without needing any extra columns:

    Column A : Insert your figures complete with gaps

    In B2 put =IF(ISBLANK(A2),SUM(A$1 : A2)-SUM(B$1:B1),"")
    and copy formulae down.
    Stompa
  • wanted to put in sub totals of each group of data (as per the red boxes), what way can I best do this?
    Cheers

    Sort on the columns you want to group on so all the value for each group come together, then do Data / Subtotal. It will do it at each change in the sorted columns all the way down and also put group & Outline on so you can precis your data.

    This still uses the subtotal function but it puts them in for you.
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 351K Banking & Borrowing
  • 253.1K Reduce Debt & Boost Income
  • 453.6K Spending & Discounts
  • 244K Work, Benefits & Business
  • 598.9K Mortgages, Homes & Bills
  • 176.9K Life & Family
  • 257.3K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.1K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.