+ Reply to Thread
Results 1 to 9 of 9

Finding the smallest difference between a range of cells? Array formula?

  1. #1
    Registered User
    Join Date
    01-04-2013
    Location
    Örebro, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    7

    Finding the smallest difference between a range of cells? Array formula?

    Hey guys,

    I have been trying to mess around with the array formula on this site
    http://www.get-digital-help.com/2007...losest-values/
    to be able to find the smallest difference of a range of cells, but I can't make it work
    This is the first time I'm using array formulas and having a Swedish version of Excel isn't really helping

    The thing is that I would like to find the smallest differences between a range of cells and - in best case - use conditional formatting to color the cells where the difference <8 red.
    I attach an example file of how the input file could look.
    numbers.xlsx

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Finding the smallest difference between a range of cells? Array formula?

    Hi.

    Can you re-attach your workbook with a few manually-calculated expected results included, just so we know what we are aiming for?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    01-04-2013
    Location
    Örebro, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Finding the smallest difference between a range of cells? Array formula?

    Hi,

    I edited the workbook a bit so the result would be more realistic. Also I added some explaining text, but will write it here too

    The purpose is to collect all data in a given range of cells (range can contain empty cells which needs to be excluded).
    These values is to be sorted in ascending order and then compared for the smallest difference by making one list containing all values except the lowest value MINUS one list containing all values except the highest one.
    As far as I understood the formula on the page I linked to in my first post, that's what it does - but with a single column (A1:A10) and the output in a single cell (the smallest difference).

    numbers.xlsx

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Finding the smallest difference between a range of cells? Array formula?

    You can get the same results as per your column AC using a single formula.

    In AC1:

    =MMULT(SMALL($B$8:$M$10,ROWS($1:1)+{0,1}),{-1;1})

    and copy down.

    Regards

  5. #5
    Registered User
    Join Date
    01-04-2013
    Location
    Örebro, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Finding the smallest difference between a range of cells? Array formula?

    Ah, thanks! Then I'm a bit closer than I were just a couple of minutes ago

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

    Re: Finding the smallest difference between a range of cells? Array formula?

    see the attached file
    Attached Files Attached Files
    Samba

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

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Finding the smallest difference between a range of cells? Array formula?

    Try this in AC1 , then drag down
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    01-04-2013
    Location
    Örebro, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Finding the smallest difference between a range of cells? Array formula?

    Wow, thanks. This is awesome!

  9. #9
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Finding the smallest difference between a range of cells? Array formula?

    If only minimum difference is required,
    Please Login or Register  to view this content.

+ 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. Replies: 1
    Last Post: 11-08-2012, 06:09 AM
  3. [SOLVED] FINDING CELL CORRESPONDING TO Kth SMALLEST IN A ARRAY
    By Alexander_Golinsky in forum Excel General
    Replies: 2
    Last Post: 07-27-2012, 08:52 AM
  4. % of difference between smallest and largest #s in a range
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-06-2010, 08:03 AM
  5. Formula for next smallest value in array
    By firefly2k8 in forum Excel General
    Replies: 1
    Last Post: 11-23-2009, 07:26 AM

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