+ Reply to Thread
Results 1 to 9 of 9

Help required on Sumproduct and Trim combined

  1. #1
    Registered User
    Join Date
    01-20-2015
    Location
    saudi
    MS-Off Ver
    2010
    Posts
    2

    Help required on Sumproduct and Trim combined

    Dear All,

    I have a formula like this =SUMPRODUCT(--(TRIM(LEFT('Feb 2013'!A:A,14))=B3),'Feb 2013'!B:B) it takes lot of time to process since I have huge data set which takes ages if I need to do any changes or additions to the data.

    The above formula trims the data that is present in the Feb 2013 sheet in column A and then and then looks whether the result matches with Cell B3 and sums up all the cells in Feb 2013 column B which matches the condition.

    The source data sheet cannot be changed or altered (Feb 2013 sheet) meaning I do not want to add any columns in the source sheet. This is because this gets circulated across - The user will only copy data from the database paste it in the source sheet so that automatically the result sheet gets updated.

    Is there anyway to use other formula to do the same job.

    Thanks in advance for your kind support in this regard.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,421

    Re: Help required on Sumproduct and Trim combined

    You should avoid using full-column references like A:A with SUMPRODUCT, as it will check every cell in that range (over 1 million of them). If you have, say, 50,000 records then changing to A$1:A$50000 (and the same with B) will certainly speed things up.

    Hope this helps.

    Pete

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Help required on Sumproduct and Trim combined

    instead of selecting entire range in sumproduct use specific range like
    =SUMPRODUCT(--(TRIM(LEFT('Feb 2013'!A1:A2000,14))=B3),'Feb 2013'!B1:B2000)
    change 2000 as per your need
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,176

    Re: Help required on Sumproduct and Trim combined

    Try this ...

    =SUMIF('Feb 2013'!A:A,B3&"*",'Feb 2013'!B:B)

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Help required on Sumproduct and Trim combined

    or try
    =SUMPRODUCT(--(TRIM(LEFT('Feb 2013'!A1:INDEX('Feb 2013'!A:A,MATCH("zzzzzzzzz",'Feb 2013'!A:A)),14))=B3),'Feb 2013'!B1:INDEX('Feb 2013'!B:B,MATCH("zzzzzzzzz",'Feb 2013'!A:A)))

  6. #6
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Help required on Sumproduct and Trim combined

    Quote Originally Posted by Phuocam View Post
    Try this ...

    =SUMIF('Feb 2013'!A:A,B3&"*",'Feb 2013'!B:B)
    how the trim function will work here

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Help required on Sumproduct and Trim combined

    The TRIM function may not be needed, but we would need to see a fair sample of data in column A to know for sure.
    The Wildcard * would handle any spaces at the end of the string in A
    But may also need the * at the beginning as well

    =SUMIF('Feb 2013'!A:A,"*"&B3&"*",'Feb 2013'!B:B)

  8. #8
    Registered User
    Join Date
    01-20-2015
    Location
    saudi
    MS-Off Ver
    2010
    Posts
    2

    Re: Help required on Sumproduct and Trim combined

    Thanks a lot for your kind support in this regard. Your help is really appreciated

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Help required on Sumproduct and Trim combined

    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. [SOLVED] VBA code required to TRIM and SPLIT the selected Range (String)
    By mchilapur in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-20-2015, 04:04 AM
  2. Countif & sumif combined required to solve answer - please help
    By ACLARKE in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-16-2013, 05:13 AM
  3. CountIFS and SUMPRODUCT Combined??
    By nobodyukno in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-10-2013, 01:59 PM
  4. SUMPRODUCT problem combined with filtering
    By Perch in forum Excel General
    Replies: 5
    Last Post: 11-27-2012, 12:04 PM
  5. Sumproduct combined with Sum
    By Exceler in forum Excel General
    Replies: 3
    Last Post: 11-25-2010, 04:14 AM
  6. SUMPRODUCT combined with other functions
    By tweety127 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-13-2008, 12:30 PM
  7. [SOLVED] Can Sumproduct and MAX/MIN be combined?
    By all4excel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-02-2008, 04:47 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