+ Reply to Thread
Results 1 to 4 of 4

Nearest cell below a certain value.

Hybrid View

  1. #1
    Registered User
    Join Date
    08-27-2015
    Location
    Oxford, England
    MS-Off Ver
    Office 2010
    Posts
    1

    Nearest cell below a certain value.

    Hi All

    I'm new to this forum, so hopefully my question is posted appropriate. Apologies if not.

    I have a column of values ranging from approximately -20 to 20. Within these values I have certain collections forming "peaks" (if the data were to be graphed), like this:

    -7.431377404
    -0.123504621
    8.267563041
    11.90999127
    10.14175866
    1.613639202
    -7.170097474
    -6.826058515

    I define anything which is part of a "peak" to be above a value of 3. How do I select all the values within one "peak" and choose the maximum? In the example above, I would want the value of 11.91 to be chosen. There are various examples of these "peaks" across my data. For example, here's another:

    0.571340419
    0.543676911
    3.162139566
    4.132734389
    1.649930702
    -0.201880797

    And here I would want 4.13 to be chosen. I have too much data to do every single one of these by hand.

    Essentially, if I imagine my data on a graph, I want something which chooses the tip of every single peak. Can this be done?

    Many thanks.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,077

    Re: Nearest cell below a certain value.

    =MAX(IF(A1:A8>3,A1:A8))
    Array formula, use Ctrl-Shift-Enter
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Nearest cell below a certain value.

    Or,

    =IFERROR(AGGREGATE(14,6,(A1:A8)/(A1:A8>3),1),"no peak above 3")

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,369

    Re: Nearest cell below a certain value.

    Special-K's formula should work, once you know which range to enter for the desired peak. Technically, I'm not sure that it is really different from a simple =MAX(A1:A8) since anything less than 3 cannot be the Max in a list of numbers that goes above and below 3. Of course, expanding this formula to include the entire data set will only find the max value of the largest peak, not the top of each peak.

    I'm not familiar with the real algorithms that are used for this kind of signal processing. If this is something you need to be proficient in, I would suggest some research into signal processing algorithms. The simple algorithm I use for this sort of thing, on the rare occasion that I need it, takes its cue from basic calculus. The "max" of the peak (assuming no noise) will be the point where the slope of the signal crosses 0 (goes from positive to negative). I will add a column that calculates slope (usually a simple (B2-B1)/(A2-A1), though I can get more complicated depending on needs), then a second helper column to "tally" up or otherwise identify where the slope crosses 0. Then I can search these columns for the maxima and minima, test for max or min, and return the maxima.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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. how far away is the nearest cell that matches this one?
    By ottenm in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-12-2014, 01:54 PM
  2. [SOLVED] look for nearest specific value and result value from a cell in same row
    By nenadmail in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-27-2014, 09:53 AM
  3. [SOLVED] Help with formula to round cell value to nearest 5
    By Master Foo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-03-2013, 03:05 PM
  4. Formula to round a cell's value down to the nearest 8?
    By amolo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-09-2013, 07:17 PM
  5. [SOLVED] Round Cell to Nearest 0.25 up-to 1.0 then to nearest 0.5
    By haynesc87 in forum Excel General
    Replies: 4
    Last Post: 05-30-2012, 01:38 PM
  6. Text searching within a cell, returning the nearest value.
    By starwarrior in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-29-2012, 09:38 AM
  7. Rounding a formula to nearest 100 within a cell
    By pjfoster in forum Excel General
    Replies: 9
    Last Post: 02-23-2012, 10:39 AM
  8. Return the nearest cell above that isn't 0
    By nofzinger in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-18-2009, 10:29 AM

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