+ Reply to Thread
Results 1 to 4 of 4

Sum range totals in a date range where range does not match criteria

  1. #1
    Registered User
    Join Date
    11-25-2021
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    2

    Sum range totals in a date range where range does not match criteria

    Hi everyone,

    I have been searching for a way to calculate a range of cells that meet two date criteria, however the problem I have is figuring out how to use SUMPRODUCT or similar as the sum range is dynamic.
    My goal is that users will be able to enter a range of figures into an 'Hours' Column, that may or may not be the same cell range as the date columns - I have attached. Users need to select two criteria for the sheet to auto calculate the date range required in B2 and B3.
    The dates in I and K are the date range that the Instalment Start and End Dates in B and C need to match with.

    So far, I have a great formula for working out a 'Weekly' range, however it all fails if any other instalment period is selected. I have the 'Hours Calculated' column set as a Named Range, however I know that this is causing the issues if the instalment selector is changed (currently using SUMIFS...). All research so far says I need to combine SUMPRODUCT and SUMIF - but I jut cannot get anything to work!

    Still quite new to advanced formulas and struggling how to nest stuff properly. Any help is appreciated! Thank you.

    HRS Calculation EXAMPLE.png


    Cell Formulas
    Range Formula
    B14:B39 B14 =LET(p,MATCH(B6,{"Weekly","Fortnightly","Monthly"},0),SEQUENCE(CHOOSE(p,26,13,6),,B6,CHOOSE(p,7,14,30.41)))
    C14:C39 C14 =B14#+IF(B6="Weekly",6,IF(B6="Monthly",29.41,13))
    H14:H26 H14 =SUMIFS(Payslip_Hours,B14#,">="&I14#,C14#,"<="&K14#)
    K14:K26 k14 =LET(p,MATCH(B7,{"Fortnightly","Monthly","Quarterly","Milestone","Lump Sum"},0),SEQUENCE(CHOOSE(p,13,6,2,2,1),,B8,CHOOSE(p,14,30.41,91,91,182)))
    M14:M26 M14 ==K14#+IFS(B7="Fortnightly",13,B7="Monthly",29.41,B7="Quarterly",90,B7="Quarterly",90,B7="Milestone",90,B7="Lump Sum",181)

    Dynamic array formulas.
    Named Ranges
    Name Refers To Cells
    Payslip_Hours =Sheet1!$D$14:$D$39

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,961

    Re: Sum range totals in a date range where range does not match criteria

    Hi and welcome to the forum

    Pictures are of little value. Honestly, no one wants to re-type your data to try and solve your issue. Additionally, we would only be guessing at how your data was structured, ie. formulas, formatting, etc. Additionally, due to how some browsers behave, many of our members cannot see uploaded pictures/images. Please do not take this route.

    Please attach a sample file that represents what you have. The structure of your attachment should be the same structure as your actual data. Any proprietary information should be changed.

    Include in the attachment any code you're currently using (whether it works or not) and an "After" of what you wish the output to be.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    11-25-2021
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    2

    Re: Sum range totals in a date range where range does not match criteria

    I have attached a sample
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,677

    Re: Sum range totals in a date range where range does not match criteria

    I am guessing that you are looking to calculate values into cells B6 and N10:N11
    For B6 it would seem that the following could work:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

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

    For future reference, it helps us understand when values are manually placed in cells that need automation so that we have something with which to compare the output of our proposed formulas/code.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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: 2
    Last Post: 12-14-2019, 05:06 AM
  2. Count occurrences of string in range, based on date range and other criteria
    By neilo1969 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-09-2019, 02:29 AM
  3. Replies: 2
    Last Post: 09-13-2017, 10:06 AM
  4. Count cells in a range that match a specific criteria in a different cell range
    By RhapsodyBay in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-13-2015, 02:10 PM
  5. [SOLVED] Median with criteria, price range and date range
    By Bravmik in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-31-2014, 01:11 AM
  6. [SOLVED] Index Match with date range criteria
    By NS4Excel in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 10-24-2013, 04:58 PM
  7. [SOLVED] reference date time range, return the value into all cell that match datetime range
    By Jarvco13 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-22-2013, 10:39 PM

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