+ Reply to Thread
Results 1 to 9 of 9

Sum a range of cells

Hybrid View

  1. #1
    Registered User
    Join Date
    06-24-2021
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    9

    Arrow Sum a range of cells

    Hello folks

    I'm sure this is very easy but I am struggling with it because of multiple rows...

    Column B has a list of names (e.g. B8:B12 = Alpha, B13:B17 = Beta etc)
    Row 10 has years (e.g. D10:F11 = 2021, G11:M11 = 2022, etc)
    Below each year and to the right of each name are values

    I'm trying to write a formula to calculate the total value for each name for each year

    2021 2022 2023
    Alpha $?
    Beta $?

    Kindly help me if possible. Or let me know if this is unclear and I will try to explain better.
    Last edited by NotTheBest; 06-24-2021 at 03:38 AM.

  2. #2
    Registered User
    Join Date
    06-24-2021
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    9

    Re: Sum a range of cells

    I have attached my file to explain, I tried writing a formula but it didn't work
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Sum a range of cells

    =SUMPRODUCT(($D$13:$X$20)*($B$13:$B$20=$D31)*($D$10:$X$10=E$30)) it works in similar ways to the sumifs each condition in the bracket results in a true or false, multiple together they become 1s and 0s which get multiplied by you sum values to get the answer you are looking for

    the below link might give you a fuller explanation with a worked example moving up to rows and columns

    https://gorilla.bi/excel/sumproduct-multiple-criteria/
    Last edited by davsth; 06-24-2021 at 03:10 AM.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Sum a range of cells

    Try:
    Formula: copy to clipboard
    =SUMPRODUCT($D$13:$X$20,($D$10:$X$10=E$30)*($B$13:$B$20=$D31))


    Edit: Whoops have not seen the previous answer.
    Best Regards,

    Kaper

  5. #5
    Registered User
    Join Date
    06-24-2021
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    9

    Re: Sum a range of cells

    thank you both that's great! I'm glad I asked as I would not have worked that out very easily, I was determined to use sumif/sumifs

    i was trying to use index match as well (unsuccessfully), would this type of formula work in these situations as well or was I barking up the wrong tree again

  6. #6
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2503 and WPS V2024(12.1.0.18543)
    Posts
    3,888

    Re: Sum a range of cells

    Quote Originally Posted by NotTheBest View Post
    thank you both that's great! I'm glad I asked as I would not have worked that out very easily, I was determined to use sumif/sumifs

    i was trying to use index match as well (unsuccessfully), would this type of formula work in these situations as well or was I barking up the wrong tree again
    SUMPRODUCT formula is much simpler, SUMIF formula is much more complicated to write, please refer to
    Cell E25 array formula , Drag down and across

    HTML Code: 

  7. #7
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Sum a range of cells

    If you had wanted one value of a range of values, index match, or offset match would have worked well to return the value. As you were wishing to sum the values this was a better approach

  8. #8
    Registered User
    Join Date
    06-24-2021
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    9

    Re: Sum a range of cells

    Thanks both for your further explanations

  9. #9
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2503 and WPS V2024(12.1.0.18543)
    Posts
    3,888

    Re: Sum a range of cells

    You're Welcome. Thank You for the feedback

+ 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. Conditional Formatting a range of cells based on a range of cells on another sheet.
    By operationsahcc in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-13-2020, 05:47 AM
  2. [SOLVED] Formula needed for add a range of cells based on date range and text in other cells
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-15-2020, 08:36 PM
  3. Replies: 6
    Last Post: 09-16-2016, 03:52 PM
  4. [SOLVED] Lock/Unlock range cells based on text value in other range cells
    By boboivan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-12-2014, 12:50 PM
  5. [SOLVED] Macro needed to clear cells in range based on value of cells in another range
    By msmith7113 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-05-2013, 12:32 AM
  6. [SOLVED] VBA Copy a range of cells values using the range of cells in a formula (which will change)
    By murtaep in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 06-05-2012, 07:59 AM
  7. Replies: 2
    Last Post: 05-31-2012, 05:37 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