+ Reply to Thread
Results 1 to 9 of 9

Help nesting SUMIF and LEFT or SUMPRODUCT LEFT & AND

  1. #1
    Registered User
    Join Date
    01-13-2022
    Location
    Denver, CO
    MS-Off Ver
    Microsoft Excel for Mac, Ver. 16.55
    Posts
    5

    Exclamation Help nesting SUMIF and LEFT or SUMPRODUCT LEFT & AND

    I’m trying to sum data where the first 8 characters in column “D” equals “PURCHASE” and the amount in Column “B” is less than 0.
    The equation below works for tallying all amounts less than 0 in column B.

    =SUMIFS(B2:B6, B2:B6, “<0”)

    When I try to test both conditions, I get an error.

    =SUMIFS( B2:B6, B2:B6, “<0”, (LEFT(D2:D6,8)),”=PURCHASE”)

    I’ve also tried various version of SUMPRODUCT

    =SUMPRODUCT((LEFT(D2:D506,8)="PURCHASE")*B2:B506)

    =SUMPRODUCT( AND( (LEFT($D$2:$D$506,8)="PURCHASE"), ($B$2:$B$506)<0 ) *$B$2:$B$506)


    Can anyone help me?
    Attached Files Attached Files
    Last edited by JMS1206; 01-13-2022 at 06:03 PM.

  2. #2
    Forum Contributor
    Join Date
    03-05-2018
    Location
    Tbilisi, Georgia
    MS-Off Ver
    2013, 2016
    Posts
    271

    Re: Help nesting SUMIF and LEFT or SUMPRODUCT LEFT & AND

    Try this:
    =SUMPRODUCT((LEFT($D$3:$D$506,8)="PURCHASE")*($B$3:$B$506<0)*$B$3:$B$506)
    OR
    =SUMIFS($B$3:$B$500,$B$3:$B$500,"<0",$D$3:$D$500,"PURCHASE*")

  3. #3
    Registered User
    Join Date
    01-13-2022
    Location
    Denver, CO
    MS-Off Ver
    Microsoft Excel for Mac, Ver. 16.55
    Posts
    5

    Re: Help nesting SUMIF and LEFT or SUMPRODUCT LEFT & AND

    EXCELLENT!!! I can't thank you enough. I was trying to figure this out for 2-days. Greatly appreciated!!!

  4. #4
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Help nesting SUMIF and LEFT or SUMPRODUCT LEFT & AND

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.
    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.

  5. #5
    Registered User
    Join Date
    01-13-2022
    Location
    Denver, CO
    MS-Off Ver
    Microsoft Excel for Mac, Ver. 16.55
    Posts
    5

    Re: Help nesting SUMIF and LEFT or SUMPRODUCT LEFT & AND

    If I only wanted to add purchase amounts in "Column B" for a specific date range in "Column A", how would I include that condition within your new formula?

  6. #6
    Registered User
    Join Date
    01-13-2022
    Location
    Denver, CO
    MS-Off Ver
    Microsoft Excel for Mac, Ver. 16.55
    Posts
    5

    Re: Help nesting SUMIF and LEFT or SUMPRODUCT LEFT & AND

    Excellent! Greatly Appreciated!

    If I only wanted to add purchase amounts in "Column B" for a specific date range in "Column A", how would I include that condition within your new formula?

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,192

    Re: Help nesting SUMIF and LEFT or SUMPRODUCT LEFT & AND

    Try

    =SUMPRODUCT((LEFT($D$3:$D$506,8)="PURCHASE")*($B$3:$B$506<0)*($A$3:$A$506>=date1)*($A$3:$A$506<=date2)*$B$3:$B$506)

    Date1 & Date2 are the start/end dates
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  8. #8
    Registered User
    Join Date
    01-13-2022
    Location
    Denver, CO
    MS-Off Ver
    Microsoft Excel for Mac, Ver. 16.55
    Posts
    5

    Re: Help nesting SUMIF and LEFT or SUMPRODUCT LEFT & AND

    The date column has data formatted as follows mm/dd/yy. How should date1 and date2 in the formula be formatted?

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,192

    Re: Help nesting SUMIF and LEFT or SUMPRODUCT LEFT & AND

    The same way: put the dates in cells (e,g. M1 and M2) so you do not have to change the formula. You can make these cells .named ranges called "Date1" and "Date2" so the formula provided can be used unchanged
    Attached Files Attached Files

+ 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. [SOLVED] snake single column into multiple columns right to left and left to right
    By Gesssssssss in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-24-2021, 10:10 AM
  2. Replies: 2
    Last Post: 05-15-2021, 10:00 AM
  3. Formula to move data to Left when LEFT cell is blank?
    By wer5150 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2019, 05:26 AM
  4. Formula to move data to Left when LEFT cell is blank?
    By wer5150 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-31-2019, 05:22 AM
  5. Replies: 6
    Last Post: 06-26-2017, 09:04 PM
  6. [SOLVED] nesting len , right and left functions.
    By hopalong in forum Excel General
    Replies: 2
    Last Post: 06-04-2012, 07:47 AM

Tags for this Thread

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