+ Reply to Thread
Results 1 to 8 of 8

SumProduct Query for a differential of more than two

  1. #1
    Forum Contributor
    Join Date
    08-10-2022
    Location
    Manchester
    MS-Off Ver
    2021
    Posts
    109

    SumProduct Query for a differential of more than two

    I am currently using the following formula

    PHP Code: 
    =SUMPRODUCT(--(H9:H17=(F9:F17+2))*(H9:H17<>""))+SUMPRODUCT(--(H9:H17=(F9:F17+3))*(H9:H17<>""))+SUMPRODUCT(--(H9:H17=(F9:F17+4))*(H9:H17<>""))+SUMPRODUCT(--(H9:H17=(F9:F17+5))*(H9:H17<>"")) 
    It works but is messy.

    I was hoping for something like SUMPRODUCT(--(H9:H17=(F9:F17+=<2))*(H9:H17<>"")) but this is rejected by excel as not valid.

    Is there a simpler way of counting the number of times cell H9 to H17 exceeds it conterpart in column F by more than 2?

    I can provide a worksheet if possible.

    I have googled and used Bingchat but not found the round solution.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,414

    Re: SumProduct Query for a differential of more than two

    As always, sample workbook, please.

    I have googled and used Bingchat but not found the round solution.
    You are allowed to ask here first - we don't have to be your last resort.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    08-10-2022
    Location
    Manchester
    MS-Off Ver
    2021
    Posts
    109

    Re: SumProduct Query for a differential of more than two

    Sample attached.

    The answer should be three.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    08-10-2022
    Location
    Manchester
    MS-Off Ver
    2021
    Posts
    109

    Re: SumProduct Query for a differential of more than two

    Quote Originally Posted by AliGW View Post



    You are allowed to ask here first - we don't have to be your last resort.
    Your signature line sums up my thoughts. I alway think it better to try and find and answer and work out why it is correct. I remember things better that way, rather than just being told that this is the way.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,414

    Re: SumProduct Query for a differential of more than two

    I agree with that wholeheartedly!

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,414

    Re: SumProduct Query for a differential of more than two

    Close, but no cigar!!!

    One tweak needed:

    =SUMPRODUCT(--(H9:H17>=(F9:F17+2))*(H9:H17<>""))

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    E
    F
    G
    H
    I
    J
    K
    9
    4
    4
    FALSE
    =H9>=F9+2
    10
    5
    5
    FALSE
    =H10>=F10+2
    11
    4
    6
    TRUE
    =H11>=F11+2
    12
    3
    3
    FALSE
    =H12>=F12+2
    13
    5
    7
    TRUE
    =H13>=F13+2
    14
    4
    3
    FALSE
    =H14>=F14+2
    15
    4
    8
    TRUE
    =H15>=F15+2
    16
    4
    4
    FALSE
    =H16>=F16+2
    17
    4
    5
    3
    FALSE
    =H17>=F17+2
    Sheet: Sheet1

  7. #7
    Forum Contributor
    Join Date
    08-10-2022
    Location
    Manchester
    MS-Off Ver
    2021
    Posts
    109

    Re: SumProduct Query for a differential of more than two

    Thank you - It's absolutely spot on. I knew I wasn't far out, but I wouldn't have thought have putting the < where it does go.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,414

    Re: SumProduct Query for a differential of more than two

    You're welcome.

+ 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. Sumproduct query
    By dfarley in forum Excel General
    Replies: 5
    Last Post: 02-11-2021, 05:25 PM
  2. SUMPRODUCT query
    By colgor in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 05-16-2016, 01:24 PM
  3. Multiply Differential slabs with differential rates
    By Masa1989 in forum Excel General
    Replies: 3
    Last Post: 03-02-2016, 01:01 PM
  4. Sumproduct Query
    By savetrees in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-10-2014, 03:37 AM
  5. Sumproduct and averaging date differential
    By Josh_123456 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-21-2014, 01:40 AM
  6. Help with a sumproduct query
    By john dalton in forum Excel General
    Replies: 8
    Last Post: 04-11-2011, 10:23 AM
  7. Sumproduct Query
    By jtwork in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-06-2007, 09:25 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