+ Reply to Thread
Results 1 to 7 of 7

Finding next smallest value?

  1. #1
    Registered User
    Join Date
    03-12-2016
    Location
    Seattle, Washington
    MS-Off Ver
    365
    Posts
    7

    Finding next smallest value?

    I'm trying to subtract 900 (C21) from the next smallest value. How would I do this? My values are
    C8 547
    C9 769
    C10 855
    C11 922
    C12 1024
    C13-19 blank data fields

    So it would be 900-855. I only want it to show up if it gives a positive answer. How would I write this in a formula?

    This is what I have so far but obviously I've done something wrong
    =C21-(SMALL($C$8:$C$19,1+COUNTIF($C$8:$C$19,SMALL($C$8:$C$19,-1))))

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,228

    Re: Finding next smallest value?

    Hi Wilson and welcome to the forum,

    Try this..

    =900-VLOOKUP(900,$C$8:$C$12,1,TRUE)
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    03-12-2016
    Location
    Seattle, Washington
    MS-Off Ver
    365
    Posts
    7

    Re: Finding next smallest value?

    Thanks Marvin that's what I was looking for!

    One more issue I had is if C21 is blank the formula gives me an answer of "#N/A". How would I get the formula to output "0" instead?

    =C21-VLOOKUP(C21,$C$8:$C$19,1,TRUE)

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,937

    Re: Finding next smallest value?

    =c21-small(c8:c18,countif(c8:c18,"<"&c21))
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,405

    Re: Finding next smallest value?

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

  6. #6
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,175

    Re: Finding next smallest value?

    Or try this: =C21-MAX(IF(C8:C19<C21,C8:C19,""))
    Enter with Ctrl+Shift+Enter

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Finding next smallest value?

    If the formula that MarvinP gave you works correctly and all you want is a 0 if C21 is blank, this will do it.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I substituted 1 for TRUE just to shorten the formula a wee bit. The IFERROR returns the 0 at the end of the formula if C21 is blank.
    You also mention another requirement of having answers show if greater than 0 and no error values if C21 is blank.
    I think that this meets all the requirements that you have mentionned.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    If C21 is blank, a blank is returned
    If C21's value produces a negative value then 0 is returned
    If C21's value produces a positive value, that value is returned.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

+ 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. Finding Smallest Value within a Range
    By jtsanabria in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-30-2014, 01:42 PM
  2. Finding the column with the smallest value..
    By gbzilla in forum Excel General
    Replies: 10
    Last Post: 07-09-2012, 08:22 AM
  3. Finding the 2nd smallest number
    By knighttrader in forum Excel General
    Replies: 3
    Last Post: 07-28-2008, 07:16 PM
  4. Finding Smallest Value
    By Phil in forum Excel General
    Replies: 5
    Last Post: 05-28-2006, 08:30 PM
  5. [SOLVED] Finding the three smallest numbers
    By Jan Kronsell in forum Excel General
    Replies: 2
    Last Post: 05-13-2006, 01:35 PM
  6. [SOLVED] finding next smallest value in a column
    By Greg in forum Excel General
    Replies: 2
    Last Post: 02-02-2006, 02:10 PM
  7. Finding smallest numbers
    By Mike7 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-21-2005, 07:39 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