• 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
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Trying to sum the row of a table between 2 dynamic columns|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Trying to sum the row of a table between 2 dynamic columns|General Excel Questions & Answers|Excel Forum|My Online Training Hub

vba course banner

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…Trying to sum the row of a table be…
sp_PrintTopic sp_TopicIcon
Trying to sum the row of a table between 2 dynamic columns
Avatar
Steve Milligan

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
May 10, 2023
sp_UserOfflineSmall Offline
1
May 10, 2023 - 6:49 pm
sp_Permalink sp_Print

Hi,
I have a timesheet where I currently have to update the formula in columns J & K each week to reference the columns that I want to total up.

I would like to be able to use the named cells "StartDate" and "EndDate" (cells E7 & E8) in the formulas in columns J&K so that it is dynamic.

I have tried a few formulas to pick up the date but I cannot get it to work. I am sure I am missing something simple.

The attached sheet show a couple of example rows which hopefully make the issue clear.

Many thank in advance for your assistance.

Steve

sp_AnswersTopicSeeAnswer See Answer
Avatar
Hans Hallebeek
the Netherlands
Member
Members
Level 0
Forum Posts: 121
Member Since:
October 17, 2018
sp_UserOfflineSmall Offline
2
May 11, 2023 - 4:04 pm
sp_Permalink sp_Print

How are you referencing the named ranges in your formula?

Avatar
Steve Milligan

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
May 10, 2023
sp_UserOfflineSmall Offline
3
May 11, 2023 - 10:19 pm
sp_Permalink sp_Print

Hi,
Obviously the file upload failed at first.

Hopefully this clears it up.

Kind regards

Steve

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


Trusted Members

Moderators

Power BI
Level 0
Forum Posts: 490
Member Since:
January 31, 2022
sp_UserOfflineSmall Offline
4
May 12, 2023 - 3:05 pm
sp_Permalink sp_Print

The problem is that the dates in the header row of a structured table are in fact text whereas the Start and End dates in E7 and E8 are real dates. So you need to create a text representation of those real dates (F7 and F8 in the attached file) first and then use INDIRECT to concatenate a dynamic reference to the correct columns in the Projects table. The formula in J will then look like this:

=IF([@[Billable?]]="N",SUM(INDIRECT("TableProjects5[@[" & $F$7 & "]:[" & $F$8 & "]]")),0)

And in K it would be:

=IF([@[Billable?]]="Y",SUM(INDIRECT("TableProjects5[@[" & $F$7 & "]:[" & $F$8 & "]]")),0)

See attached.

sp_AnswersTopicAnswer
Answers Post
Avatar
Hans Hallebeek
the Netherlands
Member
Members
Level 0
Forum Posts: 121
Member Since:
October 17, 2018
sp_UserOfflineSmall Offline
5
May 12, 2023 - 4:22 pm
sp_Permalink sp_Print

I struggled many times with columns where I wanted dates in tables.

The solution that helped me was to leave the new column as default of as text as you have but the row above the neader to dor the actual data as value and use the headerrowrange.cells(1,cellcolumn).Offset(-1,0) as value

I get errors updating links to an external file (common mistake of posted attachments) Timesheets2023 

 

Hope my explanation makes sense

Avatar
Steve Milligan

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
May 10, 2023
sp_UserOfflineSmall Offline
6
May 12, 2023 - 4:58 pm
sp_Permalink sp_Print

Hi Riny,
That works - thank you! I had been trying to use indirect but was encountering an error in my syntax. The converting the real date to text was the step I was missing.

Kind regards

Steve

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Sherry Fox
Guest(s) 11
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 216
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Melanie Ford
Isaac Felbah
Adele Glover
Hitesh Asrani
Rohan Abraham
Anthony van Riessen
Erlinda Eloriaga
Abisola Ogundele
MARTYN STERRY
Rahim Lakhani
Forum Stats:
Groups: 3
Forums: 24
Topics: 6356
Posts: 27793

 

Member Stats:
Guest Posters: 49
Members: 32324
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.