+ Reply to Thread
Results 1 to 7 of 7

SUMPRODUCT needs to ignore letters and ""

  1. #1
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Shropshire, England
    MS-Off Ver
    Excel 2007 /10 /13
    Posts
    118

    SUMPRODUCT needs to ignore letters and ""

    I have a Sumproduct function that seems to work perfectly well, as long as the main data range doesn't have any letters or "" in.

    this is an example of the function

    =SUMPRODUCT(($A$1:$A$896=AD882)*($B$1:$B$896="CFT")*($C$1:$AA$1>($AD$880-7))*($C$1:$AA$1<=$AD$880)*($C$2:$AB$896))
    where $AD$880 is a date, I'm trying to get a sum of the data for a week at a time.

    How can I get it to ignore any letters or "" that are in the range of $C$2:$AB$896?

    thanks

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

    Re: SUMPRODUCT needs to ignore letters and ""

    Try this array formula entered with CTRL + SHIFT + ENTER

    =SUM(IF($A$1:$A$896=AD882,IF($B$1:$B$896="CFT",IF($C$1:$AA$1>($AD$880-7),IF($C$1:$AA$1<=$AD$880,IF(ISNUMBER($C$2:$AB$896),$C$2:$AB$896))))))

  3. #3
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: SUMPRODUCT needs to ignore letters and ""

    Hi,

    Even without the issue of text entries in one of the arrays, I'm slightly curious as to how this formula could "work perfectly well", since I see at least two other issues with it on inspection:

    SUMPRODUCT requires that arrays be of equal sizes - your final array ($C$2:$AB$896) is of a height different to the others in your formula.

    Similarly, you have included a single-row array ($C$1:$AA$1) in the calculation, which, when multiplied by your resultant single-column array, will most likely give either incorrect results or error values.

    Can you post a workbook and illustrate what it is you are trying to achieve?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

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

    Re: SUMPRODUCT needs to ignore letters and ""

    Good catch on the misalligned ranges...

    This should be more accurate

    =SUM(IF($A$2:$A$896=AD882,IF($B$2:$B$896="CFT",IF($C$1:$AB$1>($AD$880-7),IF($C$1:$AB$1<=$AD$880,IF(ISNUMBER($C$2:$AB$896),$C$2:$AB$896))))))

    Still array entered with CTRL + SHIFT + ENTER
    Last edited by Jonmo1; 09-25-2013 at 09:14 AM.

  5. #5
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Shropshire, England
    MS-Off Ver
    Excel 2007 /10 /13
    Posts
    118

    Re: SUMPRODUCT needs to ignore letters and ""

    thanks guys, this worked fine
    XOR - you were right, it was off there, I had moved the range to another sheet to try and not moved correctly

    Thanks for your help!

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

    Re: SUMPRODUCT needs to ignore letters and ""

    Glad to help, thanks for the feedback.

    Actually, the IF(ISNUMBER part is not necessary after all.
    SUM ignores text by design anyway.

    So
    =SUM(IF($A$2:$A$896=AD882,IF($B$2:$B$896="CFT",IF($C$1:$AB$1>($AD$880-7),IF($C$1:$AB$1<=$AD$880,$C$2:$AB$896)))))

    Still array entered.

  7. #7
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Shropshire, England
    MS-Off Ver
    Excel 2007 /10 /13
    Posts
    118

    Re: SUMPRODUCT needs to ignore letters and ""

    great, taken that out, thanks again

+ 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: 10
    Last Post: 03-05-2011, 06:52 PM
  2. VB Macro for Proper Case to Ignore "/" & "-"
    By jlcford in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-08-2008, 07:49 AM
  3. Changing first letter to caps, letters after "-" and "/", and rest to small letter.
    By rhexis07 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-17-2008, 08:03 PM
  4. SUMPRODUCT(--ISNUMBER(FIND("AM",C5:160))*(k5:k160="")
    By redneck joe in forum Excel General
    Replies: 5
    Last Post: 08-18-2006, 03:31 PM
  5. [SOLVED] Sumproduct to ignore text and ""
    By Ricky Pang in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-10-2005, 03:40 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