+ Reply to Thread
Results 1 to 10 of 10

Position of the most recent X

  1. #1
    Registered User
    Join Date
    08-03-2015
    Location
    Peterborough
    MS-Off Ver
    Excel 2007
    Posts
    26

    Position of the most recent X

    Hi,

    We like to maintain one of our machines by the number of rolls that have passed through it. We record this on Excel and I get the operators to record X in the service clean box when the machine has been cleaned.

    =24-(LOOKUP(2,1/(Table1[WO]<>""),ROW(Table1[WO]))-LOOKUP(2,1/(Table1[Service Clean]<>""),ROW(Table1[Service Clean])))

    This then tells us how long until the 24 service clean(the reason for 24 at the start of the formula.) The above formula works well when the operators fill in the table down. However for some reason on the next line the operators fill the table by inserting a new line at the top. I'm getting resistance to changing that and there is some historic macros that would need to be changed so I want to avoid this at all costs.

    Is there a way to change the formula so that it works in reverse. It looks for the position of the first X in the column. In the example it is cell D7. Then counts upwards to row B. So it informs me with done 5 rolls since the last clean?

    Cheers,

    Tom
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Position of the most recent X

    Hi,

    Maybe

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    08-03-2015
    Location
    Peterborough
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Position of the most recent X

    =MATCH("x",D:D)-ROW($A$1)-1

    Match finds the position of the last X, so will always find the oldest clean.

    I could filter by Row A1:A30 but that seems like if we went over 30 it wouldn't display correctly. However, I know if it didn't display they haven't cleaned in the last 30. IF I did an if at this point to display clean is over due that might work.
    Last edited by Howlin; 12-07-2015 at 07:44 AM. Reason: to give more information

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Position of the most recent X

    Hi,

    So what are you saying?

    Do you mean with several x's in the column you want to find the number of rows between the last x and the penultimate x?

  5. #5
    Registered User
    Join Date
    08-03-2015
    Location
    Peterborough
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Position of the most recent X

    So as the spreadsheet is used there become more and more X's in Column D.

    I'd like to no when the first X is It's position away from row 2. So the number of rows between. THere should be a X in column B unless they have cleaned after that roll.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Position of the most recent X

    Hi,

    Would you offer a few examples please. I'm struggling to understand your exact requirement.

    Add different sets of x's and for each set indicate the value you want the formula to return.

  7. #7
    Registered User
    Join Date
    08-03-2015
    Location
    Peterborough
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Position of the most recent X

    I've created 3 examples in the attached sheetExcel query 5.xlsx

    To show you what I want to count. I also coloured in yellow the rolls after the clean and noted in the number it should be. Hope it is clearer now.

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Position of the most recent X

    Hi,

    In that case it just needs a 'False' argument in the original formula I gave.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    08-03-2015
    Location
    Peterborough
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Position of the most recent X

    Perfect thanks!

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Position of the most recent X

    My pleasure and thanks for the rep.

+ 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. Dynamic userform position based on widow position
    By Manish84 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-16-2015, 07:47 AM
  2. Replies: 1
    Last Post: 07-27-2014, 10:57 AM
  3. Replies: 2
    Last Post: 08-09-2012, 03:13 PM
  4. Replies: 1
    Last Post: 06-22-2012, 08:59 PM
  5. Cell position according to active cell's position
    By EXCELOST in forum Excel General
    Replies: 3
    Last Post: 02-13-2011, 05:22 AM
  6. Position cell in top left position
    By Hein in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-07-2009, 05:48 AM
  7. Position of CellCursor on Screen (absolute position)
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-22-2005, 10:25 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