+ Reply to Thread
Results 1 to 3 of 3

Summing cells from a column if an adjacent column contains a specified value

  1. #1
    Registered User
    Join Date
    11-30-2011
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question Summing cells from a column if an adjacent column contains a specified value

    I'm looking for some help with an issue I'm having in excel. I am looking to generate a sheet that summarizes data that I export from a health website on a daily basis.

    In Column A, I have multiple values representing a meal or time of day (i.e. breakfast, afternoon, midnight, etc.) and in Column's D through J are cells I want to sum. Every row of data is an individual food item I consumed that day, so that means column A can contain multiple "breakfasts" or any time label for that matter.

    With additional rows of exported data existing below the "Meals" section of the export, with cells that contain data, I want to generate a formula that allows me to sum an entire column, given that the the adjacent cell in Column A contains one of eight specified labels that are only used for the "Meals" section of the report (mentioned above).

    I've been playing with Sumifs, Vlookups, and match to generate a formula, but I haven't been able to get it to work yet. I am hoping that some one knows how to get this to work.
    Attached Files Attached Files
    Last edited by NBVC; 11-30-2011 at 04:19 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Summing cells from a column if an adjacent column contains a specified value

    Do you mean?

    In B4, for Calories:

    =SUM(INDEX('11.29'!E:E,MATCH("Meal",'11.29'!A:A,0),0):INDEX('11.29'!E:E,MATCH("Fitness",'11.29'!A:A,0)-1,0))

    copied down and adjust the '11.29'!E:E ranges to '11.29'!F:F for sugars, etc...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    11-30-2011
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Summing cells from a column if an adjacent column contains a specified value

    Thanks NBVC! I wasn't aware of the Index function and it looks like something that is very helpful to know.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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