+ Reply to Thread
Results 1 to 4 of 4

Summing values if it comes below a certain word in a long column

  1. #1
    Registered User
    Join Date
    07-01-2022
    Location
    UK
    MS-Off Ver
    365
    Posts
    1

    Summing values if it comes below a certain word in a long column

    Hello all, my first post on the forum!

    I have a long list of data in an annoying format a bit like the following:

    Column A
    Red
    5
    Blue
    2
    Blue
    4
    Green
    1
    Red
    3

    I would like to sum all the values for a certain colour, i.e. sum every number that comes directly under the word "blue"
    Have looked all over for a solution, would massively appreciate any help on this

    Thanks in advance

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,422

    Re: Summing values if it comes below a certain word in a long column

    Welcome to the forum.

    One way:

    =SUMPRODUCT(($A$1:$A$9="Blue")*($A$2:$A$10<>""),$A$2:$A$10)

    Note the relative ranges!!!
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Summing values if it comes below a certain word in a long column

    or make a new table with formula:

    F1= color

    G1 = value

    F2=INDIRECT("A"&(ROW()-1)*2) and drag down.

    G2=INDIRECT("A"&(ROW()-1)*2+1) and drag down.

    After that at pivot table.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,366

    Re: Summing values if it comes below a certain word in a long column

    Also:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Or

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. Replies: 11
    Last Post: 07-25-2021, 09:46 AM
  2. Replies: 2
    Last Post: 01-26-2016, 07:13 PM
  3. Take multiple column'S values and APPEND 1 long consecutive column
    By jcpreta in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-28-2015, 07:34 AM
  4. [SOLVED] Transpose a long column into delimiters separated values according to values in input box
    By prkhan56 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-27-2014, 01:32 PM
  5. Replies: 5
    Last Post: 12-24-2013, 08:38 AM
  6. Replies: 2
    Last Post: 07-14-2012, 02:08 AM
  7. Replies: 2
    Last Post: 11-11-2008, 11:19 AM

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