• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Sum values in a table based on 3 variables - column, UpperRow and LowerRow|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Sum values in a table based on 3 variables - column, UpperRow and LowerRow|General Excel Questions & Answers|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…Sum values in a table based on 3 va…
sp_PrintTopic sp_TopicIcon
Sum values in a table based on 3 variables - column, UpperRow and LowerRow
Avatar
Robert Green
Member
Members
Level 0
Forum Posts: 19
Member Since:
November 9, 2020
sp_UserOfflineSmall Offline
1
March 15, 2022 - 5:01 am
sp_Permalink sp_Print

Hi again,

I have a table of numbers and I need to be able to sum the values in a particular column, from a particular start row and end row, based on selections. 

For the attached example, I want to be able to sum the number in the column 'Product C' and the Size between 4 and 40.

Can anyone advise please?

Many thanks

Avatar
Jessica Stewart
Northern USA
Member
Members


Trusted Members
Level 0
Forum Posts: 202
Member Since:
February 13, 2021
sp_UserOfflineSmall Offline
2
March 15, 2022 - 9:50 am
sp_Permalink sp_Print

Hi Robert!

Use Index/Match to find the range you want inside a Sum.

=SUM(INDEX(Table1[[Product A]:[Product E]],MATCH(I3,Table1[Size],0),MATCH("Product "&I2,Table1[[#Headers],[Product A]:[Product E]],0)):INDEX(Table1[[Product A]:[Product E]],MATCH(I4,Table1[Size],0),MATCH("Product "&I2,Table1[[#Headers],[Product A]:[Product E]],0)))

🙂 Happy Excelling!

Avatar
Riny van Eekelen
Örnsköldsvik, Sweden
Moderator
Members


Trusted Members

Moderators

Power BI
Level 0
Forum Posts: 440
Member Since:
January 31, 2022
sp_UserOfflineSmall Offline
3
March 15, 2022 - 4:19 pm
sp_Permalink sp_Print

As a variant you could use:

=SUM(MMULT((Table1[Size]>=I3)*(Table1[Size]<=I4),--(Table1[[#Headers],[Product A]:[Product E]]=H2&" "&I2))*Table1[[Product A]:[Product E]])

Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
4
March 15, 2022 - 7:27 pm
sp_Permalink sp_Print

Another solution

=SUMIFS(D:D,A:A,">="&I3,A:A,"<="&I4)

Avatar
Robert Green
Member
Members
Level 0
Forum Posts: 19
Member Since:
November 9, 2020
sp_UserOfflineSmall Offline
5
March 15, 2022 - 8:28 pm
sp_Permalink sp_Print sp_EditHistory

Thank you, Jessica, Riny and Sunny.

I am going to have to work through these to better understand how they operate. I was starting with INDIRECT but struggling to locate the correct ROW.

 

I also need to check that the ROW numbers in I3 and I4 exist. If they don't then they default to the Size number smaller.  

So if I3 has 12 and I4 has 99, then the SUM is from Size 10 to Size 50. 

 

Sunny - your solution only works on Column D (For Product C).

 

Many thanks

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 870
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
6
March 16, 2022 - 8:40 am
sp_Permalink sp_Print

Hello,

See attached file, should work fine as long as I3 is 54 or less. You can tweak it further if needed.

Br,
Anders

Avatar
Robert Green
Member
Members
Level 0
Forum Posts: 19
Member Since:
November 9, 2020
sp_UserOfflineSmall Offline
7
March 16, 2022 - 7:48 pm
sp_Permalink sp_Print

Thank you, Anders.

I can also see that if I remove the = sign from the inequality in Riny's solution, that I get the same result.

 

Thank you everyone. Much food for thought here. Once again, an excellent forum.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Lionel Baijot, Jack Brett, Ben Hughes
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Hayden Hao
Angela chen
Sean Moore
John Chisholm
vexokeb sdfg
John Jack
Malcolm Toy
Ray-Yu Yang
George Shihadeh
Naomi Rumble
Forum Stats:
Groups: 3
Forums: 24
Topics: 6211
Posts: 27238

 

Member Stats:
Guest Posters: 49
Members: 31891
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.