+ Reply to Thread
Results 1 to 8 of 8

Summing up an array with non numeric values

  1. #1
    Registered User
    Join Date
    07-18-2017
    Location
    UK
    MS-Off Ver
    2010
    Posts
    21

    Summing up an array with non numeric values

    Hi all.

    Can anyone help me please.

    I am trying to sum all the numeric values in the array in cell B13 but I keep getting this error.

    The offset function produces this array: {67;53;"Data";"Data";81;"Data";70;"Data";"Data";"Data"}

    Is there a way to sum only the numbers within this array? Either by using OFFSET function or any other function?

    Thanks.

    Edit: Apologies for not being very clear. I want the formula to sum the values in the array B2:B11 based on its index in A2:A11.
    so the indexes are {4, 3, 0, 0, 8, 0, 5, 0, 0, 0,}. But as "0" is not an index value, it would lead to an error. So the required formula should ignore "0" values, and only count non zero values.
    So the final result in B13 should be "271" based on {67 + 53 + 81 + 70}. These values have indexes {4, 3, 8, 5}.
    Attached Files Attached Files
    Last edited by Subtle; 09-24-2019 at 10:20 AM.

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Summing up an array with non numeric values

    What, specifically in your sample, should the working formula do?

    What would the desired result of that working formula be?

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,056

    Re: Summing up an array with non numeric values

    What are you wanting to do (in words...) A non-working formula does not help!! Your explanation didn't help much, either, as there are 3 columns of numbers with no interspersed text!!
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Summing up an array with non numeric values

    May be...
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Confirmed as array (CTRL + SHIFT + ENTER)

    EDIT: I'm guessing that OP wanted to sum Data column based on # listed in Index column (i.e. Row# 4 = 67, 3 = 53, 0 = null etc).
    Last edited by CK76; 09-24-2019 at 09:55 AM.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Summing up an array with non numeric values

    I see the OP edited post #1.

    CK's formula should work. You can also use this:

    =SUMPRODUCT(COUNTIF(A2:A11,B2:B11),C2:C11)

    Side note: I recommend putting at least one blank column between A and B since they are not related like columns B and C are.
    This alone created some confusion (at least for me).

  6. #6
    Registered User
    Join Date
    07-18-2017
    Location
    UK
    MS-Off Ver
    2010
    Posts
    21

    Re: Summing up an array with non numeric values

    @ck

    Genious solution. This works. Well done and thank you very much.

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Summing up an array with non numeric values

    Glad we could help.

  8. #8
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Summing up an array with non numeric values

    You are 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. Replies: 15
    Last Post: 07-22-2014, 07:33 PM
  2. Replies: 1
    Last Post: 11-03-2011, 11:43 AM
  3. Summing numeric parts of alphanumeric values
    By amdk8800 in forum Excel General
    Replies: 10
    Last Post: 11-17-2009, 08:27 PM
  4. Summing the values of a generated array.
    By CacheUK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2008, 07:32 AM
  5. [SOLVED] Summing values from array
    By Garth in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-06-2006, 12:00 PM
  6. [SOLVED] Summing Like Element Array Values
    By DMS in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-16-2005, 07:05 PM
  7. [SOLVED] How to use an array or matrix to return text vs. numeric values
    By Ingrid in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-09-2005, 08:08 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