+ Reply to Thread
Results 1 to 6 of 6

Using of SUM function for the array.

  1. #1
    Registered User
    Join Date
    08-27-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    3

    Question Using of SUM function for the array.

    Hi everyone!

    As I didn't find an appropriate solution I want to ask if you could help me with optimization of the following formula using the SUM function. I eventually don't get it/get it wrong.

    Initially I needed to calculate the number of cells (in a column E4:E18), which are filled in with numbers, so I've came up with the following solution:
    =IF(E4<>"", 1)+IF(E5<>"", 1)+IF(E6<>"", 1)+IF(E7<>"", 1)+IF(E8<>"", 1)+IF(E9<>"", 1)+IF(E10<>"", 1)+IF(E11<>"", 1)+IF(E12<>"", 1)+IF(E13<>"", 1)+IF(E14<>"", 1)+IF(E15<>"", 1)+IF(E16<>"", 1)+IF(E17<>"", 1)+IF(E18<>"", 1)
    I definitely realize, that this is a kindergarden, but modifying to:
    =SUM(IF(E4:E18<>"", 1))
    didn't give me a valid result.

    Could you tell me, what should be changed?

    Sincerely,
    Alex

  2. #2
    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
    79,369

    Re: Using of SUM function for the array.

    Have you tried this?

    =COUNT(E4:E18)
    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.

  3. #3
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Using of SUM function for the array.

    Maybe

    =countif(E4:E18,">0")

    Kind regards
    Leo

  4. #4
    Registered User
    Join Date
    08-27-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    3

    Re: Using of SUM function for the array.

    Thanks! Feels awful

  5. #5
    Registered User
    Join Date
    08-27-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    3

    Re: Using of SUM function for the array.

    Thanks! I definitely have to go through the basic functions

  6. #6
    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
    79,369

    Re: Using of SUM function for the array.

    Hey, look - we all started somewhere. What seems like childsplay now was an uphill struggle at the start. Don't feel embarrassed!

+ 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: 3
    Last Post: 04-02-2016, 08:16 PM
  2. UDF array function doesn't return array
    By taikalusikka in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-18-2016, 08:06 AM
  3. [SOLVED] Using Offset function as the array in the PercentRank function is giving wrong result
    By Bobneil in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-06-2013, 09:29 PM
  4. Array function only displays first value of array as output
    By q-tip in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-04-2013, 12:51 PM
  5. SEARCH function returns array if first argument is array--Huh?
    By 6StringJazzer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-10-2012, 07:23 PM
  6. Using the ReDim array function in a multidimensional array in excel
    By Doruli in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-05-2012, 01:43 PM
  7. Read Range To Array, Then Pass Array To Function
    By ProbablyNotARealName in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-20-2010, 12:29 PM

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