+ Reply to Thread
Results 1 to 7 of 7

exception of zero

  1. #1
    Registered User
    Join Date
    05-25-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2013
    Posts
    5

    exception of zero

    in the colum "laagste prijs" i want to avoid "0" the formula in this colum is to select the lowest price. the zero means that the shop (here sax) cannot deliver the goods. instead of zero in "laagste prijs" this should be 15,42. how can i solve this?
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: exception of zero

    Try this in cell I2 and copy down: =IF(COUNTIF(F2:G2,0)>0,SUM(F2:G2),SMALL(F2:G2,1))

    Is that what you mean?

    There are probably much tidier ways of doing this.

  3. #3
    Registered User
    Join Date
    05-25-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: exception of zero

    I'm sorry this is not working. i do not get get logic of this formula.
    if you say there are better ways to do this, please propose those as i'm alwaays interested to do better.
    thank you

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: exception of zero

    What do you mean by it's not working? Is it not giving you the right result or giving you an error message.

    The logic behind the formula is is checks to see if either values in columns F or G are zero, and if so it sums the two columns on that row, effectively giving you the smallest number other than zero. If neither are zero it does what you had before and uses SMALL to return the smallest of the two numbers.

    If you search this forum for SMALL IF you will find another solution to this problem, but it uses an array formula.

    Attached is your file with my formula in it. Appears to work to me.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-25-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: exception of zero

    hey, thank you
    like often the mistake is in the smallest corner. I used an "," instead of ";". SORRY

    my problem is solved!

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: exception of zero

    Glad to help

  7. #7
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: exception of zero

    Quote Originally Posted by BadlySpelledBuoy View Post
    Try this in cell I2 and copy down: =IF(COUNTIF(F2:G2,0)>0,SUM(F2:G2),SMALL(F2:G2,1))

    Is that what you mean?

    There are probably much tidier ways of doing this.
    Yes, there are tidier ways...

    Non array formula:
    =SMALL(F2:G2,COUNTIF(F2:G2,)+1)

    Array formula:
    =MIN(IF(F2:G2<>0,F2:G2))

    Array formula press Ctrl+Shift+Enter, not just Enter

+ 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. COM exception
    By grasyl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-25-2011, 04:41 AM
  2. find with exception
    By Hammer_757 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2009, 03:32 PM
  3. Using an IF function, with an exception
    By Renegade88 in forum Excel General
    Replies: 2
    Last Post: 10-11-2007, 10:54 AM
  4. exception to MsgBox
    By L Scholes in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-14-2006, 02:46 AM
  5. Exception deleting
    By cj21 in forum Excel General
    Replies: 5
    Last Post: 01-26-2006, 12:05 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