+ Reply to Thread
Results 1 to 13 of 13

Recount/Reorder

  1. #1
    Registered User
    Join Date
    06-05-2017
    Location
    Missouri
    MS-Off Ver
    2013
    Posts
    62

    Recount/Reorder

    Hello,

    Can you provide me a formula that will recount if a number is missing?

    For instance if I have 1,2,3,5 but I only want to see 1,2,3,4 because I don't need 5... How would I write that


    A little bit trickier... If I want to Add in into the formula as well...
    Example I have 1, 2, 3, All, 5... How can I get it to show 1, 2, 3, All, 4

    I have included an attached spreadsheet that show the numbers in column B how the result will display currently, column C is for the formula to reorder column B... and I have added column F to show how the results should show.

    Your help is greatly appreciated!

  2. #2
    Registered User
    Join Date
    06-05-2017
    Location
    Missouri
    MS-Off Ver
    2013
    Posts
    62

    Re: Recount/Reorder

    See attachment
    Attached Files Attached Files

  3. #3
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Recount/Reorder

    In C14:
    Please Login or Register  to view this content.
    And pull down.

    Like that?
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

  4. #4
    Registered User
    Join Date
    06-05-2017
    Location
    Missouri
    MS-Off Ver
    2013
    Posts
    62

    Re: Recount/Reorder

    What if 3 or 2 was missing? That formula will only change the 4.
    Last edited by gilpin004; 01-23-2018 at 04:19 PM.

  5. #5
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Recount/Reorder

    Well then I guess you need to explain what you want it to actually do then.

  6. #6
    Registered User
    Join Date
    06-05-2017
    Location
    Missouri
    MS-Off Ver
    2013
    Posts
    62

    Talking Re: Recount/Reorder

    The object of the entire formula is to change the numbers to count in order if a number is missing. ((like a recount))

    If there are no 1's it will do a search within the range of numbers to find the number closest to 1.
    So lets say I have in Column A: 2, 4, 5, 6
    If it starts at 2 it will change all the 2's to 1's. Also, It will change my 4's to 2's, 5's to 3's, and 6's to 4's.

    The results in Column B would show: 1, 2, 3, 4


    Hopefully I explained it better.
    Attached Files Attached Files

  7. #7
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Recount/Reorder

    Very difficult to do in one integrated formula, not too hard using an intermediate table.

    See attached -- using the table on the "RefTable" sheet to determine which values are used, and what the effective rank is of the input value. Then it's just a lookup on that table to grind from the input value to the output.

    Note that because your "The Output Needed" column is apparently wrong (or at least, it does not match what you've asked for), the formulaic output will not match it.
    Attached Files Attached Files

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Recount/Reorder

    Can I interprete like this:
    1
    1
    1
    4
    All
    3
    5
    ...
    Get the MIN and MAX value from beginning to first "All": 1 and 4. The missing value is 2 and 3
    From first "All" downward: 3 becomes 2 (first missing value) and 5 becomes 3(second missing value)

    If it is right, in C14 then drag down:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Quang PT

  9. #9
    Registered User
    Join Date
    06-05-2017
    Location
    Missouri
    MS-Off Ver
    2013
    Posts
    62

    Re: Recount/Reorder

    Thank you! This formula works great for the attached document. Is there a formula to use if the numbers in column B were to change around? These numbers will change constantly anywhere from 1 to 5.... I tried to change the fist two number to a 3 but it doesn't seem to work work the same way.

  10. #10
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Recount/Reorder

    Can you upload the updated file with new expected results?

  11. #11
    Registered User
    Join Date
    06-05-2017
    Location
    Missouri
    MS-Off Ver
    2013
    Posts
    62

    Re: Recount/Reorder

    The results are in column F needed.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    06-05-2017
    Location
    Missouri
    MS-Off Ver
    2013
    Posts
    62

    Re: Recount/Reorder

    Is there a way i can use the RANK formula but if it has "All" in the results to return all?

  13. #13
    Registered User
    Join Date
    06-05-2017
    Location
    Missouri
    MS-Off Ver
    2013
    Posts
    62

    Re: Recount/Reorder

    Try this array formula in row 2

    =IF(ISNUMBER(A2),SUM(IF(FREQUENCY(IF(ISNUMBER(A$2:A$27),IF(A$2:A$27<A2,A$2:A$27)),A$2:A$27),1))+1,A2)

    confirm with CTRL+SHIFT+ENTER and copy down

    That gives me the same results as you showed in your "expected results" column

    see attached

+ 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] Recount/reorder formula
    By gilpin004 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-23-2018, 04:43 PM
  2. Remove rows containing certain phrases & recount number of staff in each dataset
    By Hyflex in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-28-2015, 10:59 PM
  3. Reorder First Name and Last Name
    By hokieguy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-07-2014, 08:51 PM
  4. Replies: 11
    Last Post: 10-16-2008, 05:14 PM
  5. Pivot - need to recount based on results
    By Kreed in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-19-2005, 04:05 PM
  6. reorder function
    By cb chiam in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  7. reorder function
    By cb chiam in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07:05 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