+ Reply to Thread
Results 1 to 12 of 12

Thread: Difference since last Occurrence

  1. #1
    Registered User
    Join Date
    11-20-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Difference since last Occurrence

    I attached an image with the information....

    is there a formula to give me the results??

    Thanks for any help
    Attached Images Attached Images

  2. #2
    Extremely Helpful member
    Join Date
    12-23-2006
    Location
    Belgium
    MS-Off Ver
    XL2003
    Posts
    6,127

    Re: Difference since last Occurrence

    Hi and welcome to the board

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook. Don't upload a picture when you have a workbook. None of us is inclined to recreate your data. Upload the workbook and manually add an 'after' situation so that we can see what you expect. In addition clearly explain how you get the results.

    To attach a file to your post, you need to be using the main 'New Post' or 'New Thread' page and not 'Quick Reply'.
    To use the main 'New Post' page, click the 'Post Reply' button in the relevant thread.

    On this page, below the message box, you will find a button labelled 'Manage Attachments'.
    Clicking this button will open a new window for uploading attachments.

    You can upload an attachment either from your computer or from another URL by using the appropriate box on this page.
    Alternatively you can click the Attachment Icon to open this page.

    To upload a file from your computer, click the 'Browse' button and locate the file.

    To upload a file from another URL, enter the full URL for the file in the second box on this page.
    Once you have completed one of the boxes, click 'Upload'.

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    Quoting entire posts clutters the forum and makes threads hard to read !

    If you are pleased with a member's answer then use the Star icon to rate it

    Click here to see forum rules

  3. #3
    Registered User
    Join Date
    11-20-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Difference since last Occurrence

    When I made references to A11 or A6, etc...I was just referring to the cell numbers

    I'm sorry i just saw a similar post and they posted an image so i thought it was the right way to do it.

    I attached the file... Thanks for any help again
    Attached Files Attached Files

  4. #4
    Forum Guru ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    traded up
    MS-Off Ver
    2003 & 2010
    Posts
    1,905

    Re: Difference since last Occurrence

    In cell B11, paste:

    =ROW()-MATCH(A11,$A$1:$A$10,0)-COUNTIF($A$11:A11,">"&A11)
    then autofill down.

    Cheers,
    “To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln

  5. #5
    Registered User
    Join Date
    11-20-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Difference since last Occurrence

    Quote Originally Posted by ConneXionLost View Post
    In cell B11, paste:

    =ROW()-MATCH(A11,$A$1:$A$10,0)-COUNTIF($A$11:A11,">"&A11)
    then autofill down.

    Cheers,
    The formula almost worked....It doesn't do the count right when there is a repeat. I attached the file again with the your formula so you can see what i mean....
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor Haseeb A's Avatar
    Join Date
    05-24-2011
    Location
    India | Kwt
    MS-Off Ver
    2007
    Posts
    1,460

    Re: Difference since last Occurrence

    If you are trying to count the unique numbers between last occurrences to previous, try this.

    B11, ARRAY FORMULA, copy down.

    =SUM(SIGN(FREQUENCY(INDEX(A:A,MATCH(2,1/(A$1:A10=A11))):A11,INDEX(A:A,MATCH(2,1/(A$1:A10=A11))):A11)))

    If the numbers always be <10, try,

    =SUM(SIGN(FREQUENCY(INDEX(A:A,MATCH(2,1/(A$1:A10=A11))):A11,{0;1;2;3;4;5;6;7;8;9})))
    HTH; Haseeb

    If your problem is solved, please say so clearly, and mark your thread as Solved:
    Forum Rules & How to Mark a thread as SOLVED

  7. #7
    Registered User
    Join Date
    11-20-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Difference since last Occurrence

    Quote Originally Posted by Haseeb A View Post
    If you are trying to count the unique numbers between last occurrences to previous, try this.

    B11, ARRAY FORMULA, copy down.

    =SUM(SIGN(FREQUENCY(INDEX(A:A,MATCH(2,1/(A$1:A10=A11))):A11,INDEX(A:A,MATCH(2,1/(A$1:A10=A11))):A11)))

    If the numbers always be <10, try,

    =SUM(SIGN(FREQUENCY(INDEX(A:A,MATCH(2,1/(A$1:A10=A11))):A11,{0;1;2;3;4;5;6;7;8;9})))
    Haseeb A, your formula works, thank you. Thanks to everyone for their help!!!

  8. #8
    Registered User
    Join Date
    11-20-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Difference since last Occurrence

    Follow up question....

    Is there a way to sort the results from column B 1-10 in the order of their last appearance?(skipping the repeats but just focusing on the last appearance of numbers 1-10)

  9. #9
    Registered User
    Join Date
    11-20-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Difference since last Occurrence

    I updated the file with Hasseb A's formula and added a section for my follow up questions....

    I basically want to know if there is a way to sort the numbers 0-9 in order of their last appearance.


    The highlighted area in Column A is the order of their last appearance. In column F, I placed the result.

    Is this possible?
    Attached Files Attached Files

  10. #10
    Extremely Helpful member
    Join Date
    12-23-2006
    Location
    Belgium
    MS-Off Ver
    XL2003
    Posts
    6,127

    Re: Difference since last Occurrence

    Skillz
    Don't quote whole posts -- it's just clutter.

    If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding.
    Quoting entire posts clutters the forum and makes threads hard to read !

    If you are pleased with a member's answer then use the Star icon to rate it

    Click here to see forum rules

  11. #11
    Registered User
    Join Date
    11-20-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Difference since last Occurrence

    arthurbr,

    I understand, thanks for letting me know.

    Can someone please help me with my question in post #9?

  12. #12
    Valued Forum Contributor Haseeb A's Avatar
    Join Date
    05-24-2011
    Location
    India | Kwt
    MS-Off Ver
    2007
    Posts
    1,460

    Re: Difference since last Occurrence

    One way is, use a helper column.

    See the attached.

    Hope expert will have a more efficient way without helper.


    Col_D is the helper column, you can change this to your own columns, just link the column in INDEX.
    Attached Files Attached Files
    HTH; Haseeb

    If your problem is solved, please say so clearly, and mark your thread as Solved:
    Forum Rules & How to Mark a 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)

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.2.0