+ Reply to Thread
Results 1 to 3 of 3

A peculiar conditional sum

  1. #1
    Registered User
    Join Date
    12-10-2007
    Posts
    5

    A peculiar conditional sum

    Hi,

    I've been trying for a few days to sort out a way to solve my peoblem but couldn't, so here I am :-)

    Suppose you have range, let's say A1:A5, which can contain either a numeric value or an X, and then you have cell A6 whch is the sum of the above range.

    My problem is that when all cells in range A1:A5 are X then A6 displays a zero, which I don't want: I want a blank instead.

    The reason is that I need to distinguish between all zeroes in the range and all X, but in both cases in A6 I have zero.

    I have tried in many different ways but nothing works, including the following

    A6 = IF(ISNUMBER(A1:A5); SUM(A1:A5); "")



    Thanks
    Last edited by VBA Noob; 12-10-2007 at 04:02 AM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =IF(COUNTIF(A1:A5,"x")=5," ",SUM(A1:A5))
    Change , to ; as required

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    12-10-2007
    Posts
    5
    Quote Originally Posted by VBA Noob
    Maybe



    Change , to ; as required

    VBA Noob
    mmmmm, this means that I should know how many cells I have in the range, and considering I have hundreds of such cells it would be a nightmare...

    but it's a good starting point, thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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