+ Reply to Thread
Results 1 to 7 of 7

Help with formula to return bottom five rows that are not zero

  1. #1
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    385

    Help with formula to return bottom five rows that are not zero

    Dear All

    I was wondering whether someone can help me with a formula to achieve the following:

    I have a spreadsheet (attached) which shows the dept and their sales. I need a formula to show me the bottom five departments if their sales is not zer. In the attached i need to return the worst department to be 2517 with 5 and then D392 with 5 , D308 with 15 and so on.

    My actual spreadsheet has large number of rows and lots of the sales are 0 but I only need to show the bottom 5 departments whose sales were not zero.

    Hope this makes sense and thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,359

    Re: Help with formula to return bottom five rows that are not zero

    =SMALL(IF(ISNA(MATCH($B$2:$B$27,$D$1:D1,)),$B$2:$B$27),ROWS($A$2:A2)) as array formula, d1=0

  3. #3
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    385

    Re: Help with formula to return bottom five rows that are not zero

    Dear tim201110

    Can I please ask that whether I need to do the whole formula as an array or just upto ,d1=0 as it doesn't seem to work. Sorry if I am being naive.

    What I need to do is in column d1:d5 list the bottom five departments which their sales wasn't zero and column e1:e5 show those department's sales.

    Hope this makes sense.
    Last edited by rv02; 09-18-2017 at 06:35 AM.

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2010
    Posts
    5,838

    Re: Help with formula to return bottom five rows that are not zero

    ARRAY formulas are used
    In D2, then drag down

    =INDEX($A$2:$A$27,SMALL(IF($B$2:$B$27=$E2,ROW($B$2:$B$27),""),COUNTIF($B$2:$B$27,$E2)))

    In E2 then drag down

    =SMALL(IF($B$2:$B$27>0,$B$2:$B$27,""),ROWS($E$2:$E2))
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    385

    Re: Help with formula to return bottom five rows that are not zero

    Dear kvsrinivasamurthy
    Thanks for the quick response. I looked at the sheet and it shows Dep7 2715 as sales 0f 5 twice however 2517 and D392 have sales of 5. It seems the dept numbers and their sales is not pulled through correctly.

    Any help is appreciate it

  6. #6
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,359

    Re: Help with formula to return bottom five rows that are not zero

    sorry for misunderstanding
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    385

    Re: Help with formula to return bottom five rows that are not zero

    Dear Tim201110

    This worked perfectly

    Thank you for your help

+ 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. [SOLVED] Rows copying from bottom to top. need to copy top to bottom.
    By jafvortex93 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-01-2015, 02:07 PM
  2. [SOLVED] Need INDEX MATCH formula that arranges Xs in bottom rows and then starts arranging ys
    By bkwins in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-05-2013, 09:16 AM
  3. Draw bottom border on every rows from top to bottom
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-08-2013, 09:52 AM
  4. [SOLVED] Formula to return values from all rows
    By LeePrice in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-08-2013, 05:03 AM
  5. Formula to return value for top, middle, bottom % values
    By brianjluke in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-13-2013, 03:05 PM
  6. [SOLVED] Formula with ROWS Function appears not to return correct number of rows
    By rzw30 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-22-2013, 07:05 AM
  7. [SOLVED] Formula to Return Bottom 3 Values From a Table Based on a Criteria
    By JungleJme in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 11-15-2012, 06:57 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