+ Reply to Thread
Results 1 to 8 of 8

Looking for final four values in range, excluding any blank cells

  1. #1
    Registered User
    Join Date
    08-31-2015
    Location
    New York, USA
    MS-Off Ver
    2013
    Posts
    5

    Looking for final four values in range, excluding any blank cells

    My nomenclature may be a bit off for Excel, but I値l try to explain what I知 trying to do the best I can. I may over-explain everything, but bear with me.

    End goal of what I知 trying to do: find the average of the lowest 3 values from the final 4 values in a row, excluding blank cells. I know how to use the AVG and MIN functions to create the average and find the lowest, second lowest, and third lowest values in a range, but I知 not sure how to create the four value range of the last four values (excluding blank cells).

    My thoughts on how to do this: create a range (say, A2 through P2, A2:P2), then have a function systematically check each cell (starting with P2 and working backwards towards A2) to see if it has a value, then keep doing that until it has four values.

    Attached is a screenshot of an example spreadsheet and a 2013 excel file with the example.

    I appreciate any help you guys could offer me!
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Looking for final four values in range, excluding any blank cells

    We can give you a single formula that returns the average of the lowest 3 numbers from the last 4 numbers entered without the intermediate (helper) columns.

    Do you want that?

    Will there always be at least 3 numbers in he range? If not, what result do you want?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    08-31-2015
    Location
    New York, USA
    MS-Off Ver
    2013
    Posts
    5

    Re: Looking for final four values in range, excluding any blank cells

    Thanks for the quick response, and for catching the stuff I hadn't thought of.

    I need the intermediate columns to be present (the columns showing the 3 lowest of the last four), but I assume those would be very similar formulas except they'd end at the MIN function?

    I would need the average to be the average of how ever many (of the three) present. For example, if there are only two values than it would be the average of the two. And, then, one of the three intermediate columns would be blank.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Looking for final four values in range, excluding any blank cells

    Enter this array formula** in R2:

    =IFERROR(SMALL($P2:INDEX($A2:$P2,LARGE(IF($A2:$P2<>"",COLUMN($A2:$P2)-COLUMN($A2)+1),MIN(4,COUNT($A2:$P2)))),COLUMNS($R2:R2)),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy across to T2.

    Enter this formula in U2:

    =IFERROR(AVERAGE(R2:T2),"")

    Select R2:U2 and copy down as needed.

  5. #5
    Registered User
    Join Date
    08-31-2015
    Location
    New York, USA
    MS-Off Ver
    2013
    Posts
    5

    Re: Looking for final four values in range, excluding any blank cells

    Thanks for all the help, everything worked perfectly.

    I appreciate the help; I've been able to reverse-engineer what you did and have finished a handful of things I didn't know how to do before.

    There is another thing I'm stuck on, though. It's very similar to what you already helped me with, but I think there will be an extra IF or two.

    I have attached a screenshot and excel file describing what I'm trying to do (with an example highlighted in red). Basically, I'm trying to find the lowest four values in columns E through T (E:T, labelled 1 through 16), but if there aren't four values then it should include the lowest of column A through D (A:D, labelled L1 through L4) until there are four values. This may include using all four values from columns A:D, and if there isn't four values between A:T then the it should be left blank (including if there are no values whatsoever).
    Attached Images Attached Images
    Attached Files Attached Files

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Looking for final four values in range, excluding any blank cells

    In the file, on row 19 you show the expected result as:

    1, 4, 4, 4

    I think the correct result should be:

    1, 3, 4, 4

    This formula entered in A16:

    =IFERROR(IF(COUNT($E2:$T2)>=4,SMALL($E2:$T2,COLUMNS($A16:A16)),IF(COUNT($A2:$T2),SMALL($A2:$T2,COLUMNS($A16:A16)),"")),"")

    Copy across to D16 then down as needed.

  7. #7
    Registered User
    Join Date
    08-31-2015
    Location
    New York, USA
    MS-Off Ver
    2013
    Posts
    5

    Re: Looking for final four values in range, excluding any blank cells

    That worked perfectly. Thanks for all the help, I really appreciate it.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Looking for final four values in range, excluding any blank cells

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ 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. Averaging values while excluding blank cells
    By J. M. Hardiman in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-11-2014, 11:44 AM
  2. [SOLVED] Excluding blank cells
    By Yaznayo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-14-2014, 02:31 PM
  3. vba delete blank cells in range B:B,J:J,O:O so as not affect next column values cells.
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2014, 10:44 PM
  4. Replies: 6
    Last Post: 08-16-2013, 10:04 PM
  5. Excluding blank cells from a range of data
    By Consty1 in forum Excel General
    Replies: 5
    Last Post: 10-11-2012, 03:19 PM
  6. Excel 2007 : Excluding Blank Cells
    By pxoxyx in forum Excel General
    Replies: 0
    Last Post: 04-28-2010, 01:47 AM
  7. How do I use countif to count values excluding blank cells
    By Glenda in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-30-2006, 12:30 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