+ Reply to Thread
Results 1 to 8 of 8

SUMPRODUCT across several columns

  1. #1
    Registered User
    Join Date
    03-13-2010
    Location
    Bedfordshire, England
    MS-Off Ver
    Excel 2010
    Posts
    60

    SUMPRODUCT across several columns

    I have used this code many times to look at a range of cells in column CE containing the word READING and return the total value of the number contained in corresponding rows in column CW that have a greater value than one.

    Please Login or Register  to view this content.
    The problem is that the word reading could appear across several columns but I still only want to evaluate values contained in column CW. I thought the following would work but it returns #VALUE! error.

    Please Login or Register  to view this content.
    Any advice appreciated

  2. #2
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: SUMPRODUCT across several columns

    Hi

    Because your first range is larger than the other 2 try
    Please Login or Register  to view this content.
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  3. #3
    Registered User
    Join Date
    03-13-2010
    Location
    Bedfordshire, England
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: SUMPRODUCT across several columns

    Thank you, but I can't get that to work, I think it is because SUMPRODUCT is limited to the number of cells it can compute/analyse but I can't figure out an alternative at the moment.

  4. #4
    Registered User
    Join Date
    03-13-2010
    Location
    Bedfordshire, England
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: SUMPRODUCT across several columns

    Please Login or Register  to view this content.
    This formula works but only returns the number of cells in CV117 to CV156 that are greater than 1 with a corresponding "READING" in columns CE to CL. I need to SUM these values. It seems to be counting the occurrence of these values rather than summing them.

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: SUMPRODUCT across several columns

    Roger's suggestion works for me - what result do you get? Any (non-coercable) text in the range CV$117:CV$156 will result in an error (#VALUE!)......one way round that is to use an "array formula", i.e.

    =SUM(IF(($CE$6:$CL$45="READING")*(CW$117:CW$156>1),CW$117:CW$156))

    confirmed with CTRL+SHIFT+ENTER

    Note that both that version and Roger's will sum the same row more than once if "Reading" exists more than once in the same row......is that possible?
    Audere est facere

  6. #6
    Registered User
    Join Date
    03-13-2010
    Location
    Bedfordshire, England
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: SUMPRODUCT across several columns

    Thank you daddylonglegs, your array formula works. Though I don't understand why Roger's didn't. The CV column only contains numbers to 5 decimal places but as you say it returns #VALUE!. What do you mean by "Any (non-coercable) text".

    Thank you both for your input. I would really prefer to use Roger's non array formula but fail to understand why I can't.

  7. #7
    Registered User
    Join Date
    03-13-2010
    Location
    Bedfordshire, England
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: SUMPRODUCT across several columns

    Strange, I just formatted the range of cells to text and back to number (5 decimal points) again and now Roger's formula works. Is it possible I had a cell in the range CV117:CV156 that was formatted as text, would this return #VALUE!

  8. #8
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: SUMPRODUCT across several columns

    Quote Originally Posted by BobTheRocker View Post
    Thank you daddylonglegs, your array formula works. Though I don't understand why Roger's didn't. The CV column only contains numbers to 5 decimal places but as you say it returns #VALUE!. What do you mean by "Any (non-coercable) text".

    Thank you both for your input. I would really prefer to use Roger's non array formula but fail to understand why I can't.
    Bob
    Do you want to post a sample of your data, then maybe we can see why it doesn't work for you.
    Works fine for me (and for ddl) as does the ddl Array formula.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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