+ Reply to Thread
Results 1 to 13 of 13

Identifying Occurences of a value, and numbering according to date

  1. #1
    Registered User
    Join Date
    01-23-2017
    Location
    Egypt
    MS-Off Ver
    Office 2016
    Posts
    7

    Identifying Occurences of a value, and numbering according to date

    Hi All,

    I have a tricky one for you. Its regarding counting number of occurences of a value, and numbering it earliest oldest starting with 1.

    I have a set of values, lets call them customers in Column A, next to each customer is a date in Column B. Each date represents the day he bought products in.

    I am trying to number the invoices for that each customer based on the date, first invoice getting a 1, second getting as per the date gets a 2 and so on.... in Column C. This for example enables me to filter by "third" invoice for all customers, regardless when he bought as long as it was third purchase in that month.

    Essentially i want a formula that looks for all occurrences of a value (customer), and gives that purchase instance a number according to dates earliest to newest. Check the example attached. This is very tough manually, considering in a given month i can have up to 500/600 unique customers, and each can buy up to 5 or 6 times.

    Capture2.JPG

    Hope its clear enough, i thought of going for a pivot, but it got very messy

    Thanks.
    Last edited by Feteha12; 01-23-2017 at 10:17 AM.

  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: Identifying Occurences of a value, and numbering according to date

    Maybe this...

    =COUNTIFS(A$3:A3,A3,B$3:B3,B3)

    Copy down as needed.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    01-23-2017
    Location
    Egypt
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Identifying Occurences of a value, and numbering according to date

    Thanks but it doesnt seem to tackle it, am i missing something?

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Identifying Occurences of a value, and numbering according to date

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

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

    Re: Identifying Occurences of a value, and numbering according to date

    After looking at your sequence more closely I have to say that I don't understand how you arrive at those results.

    For example, row 12...

    Customer3...18-Jan...4

    How do you arrive at 4?

    Customer3 doesn't even appear 4 times and only appears once on 18-Jan.


  6. #6
    Registered User
    Join Date
    01-23-2017
    Location
    Egypt
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Identifying Occurences of a value, and numbering according to date

    Yes you are right, its a mistake when filled manually, it should read 3 not 4..
    Will upload that workbook mockup now

  7. #7
    Registered User
    Join Date
    01-23-2017
    Location
    Egypt
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Identifying Occurences of a value, and numbering according to date

    Fixed the snapshot above, and attached is the sample workbook.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Identifying Occurences of a value, and numbering according to date

    Try

    =COUNTIF(A$3:A3,A3)

  9. #9
    Registered User
    Join Date
    01-23-2017
    Location
    Egypt
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Identifying Occurences of a value, and numbering according to date

    THANKS MATE...that actually works, the only downside is it assumed the data was entered chronologically, i.e: if the data entry person enters the older invoices then newer and so on, otherwise the count will get screwed...but i think i can work with that....

    THanks again !

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

    Re: Identifying Occurences of a value, and numbering according to date

    Data Range
    A
    B
    C
    2
    CUSTOMERS
    DATE
    Invoice sequence
    3
    Customer 1
    1-Jan
    1
    4
    Customer 1
    4-Jan
    2
    5
    Customer 1
    10-Jan
    3
    6
    Customer 2
    3-Jan
    1
    7
    Customer 2
    25-Jan
    2
    8
    Customer 2
    29-Jan
    3
    9
    Customer 3
    10-Jan
    1
    10
    Customer 3
    15-Jan
    2
    11
    Customer 3
    18-Jan
    3
    12
    Customer 5
    2-Jan
    1
    13
    Customer 5
    3-Jan
    2
    14
    Customer 1
    19-Jan
    4
    15
    Customer 2
    30-Jan
    4
    16
    Customer 1
    25th jan
    5
    17
    customer 3
    28-Jan
    4
    18
    Customer 5
    9-Jan
    3
    19
    Customer 6
    17-Jan
    1


    This formula entered in C3 and copied down:

    =COUNTIF(A$3:A3,A3)

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

    Re: Identifying Occurences of a value, and numbering according to date

    Quote Originally Posted by Feteha12 View Post
    the only downside is it assumed the data was entered chronologically, i.e: if the data entry person enters the older invoices then newer and so on, otherwise the count will get screwed...but i think i can work with that....
    If you want them number based on the dates try this version:

    =SUMPRODUCT(--(A$3:A$19=A3),--(B3>B$3:B$19))+1

  12. #12
    Registered User
    Join Date
    01-23-2017
    Location
    Egypt
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Identifying Occurences of a value, and numbering according to date

    that you mate...it was easy enough that i missed it...its always good to get a second eye

    will just make sure data is always organised chronologically and it should be good.

  13. #13
    Registered User
    Join Date
    01-23-2017
    Location
    Egypt
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Identifying Occurences of a value, and numbering according to date

    that you mate...it was easy enough that i missed it...its always good to get a second eye

    will just make sure data is always organised chronologically and it should be good.

+ 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. Looking up multiple occurences of the same date
    By rsomers in forum Excel General
    Replies: 5
    Last Post: 04-19-2013, 08:26 PM
  2. Date Occurences with Times
    By aftabn10 in forum Excel General
    Replies: 2
    Last Post: 02-03-2011, 06:23 AM
  3. How to combine occurences by date?
    By alexeipg in forum Excel General
    Replies: 6
    Last Post: 10-01-2009, 01:41 PM
  4. How do I count occurences in a date range?
    By RagDyeR in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 12:05 PM
  5. [SOLVED] How do I count occurences in a date range?
    By Jeremy in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  6. [SOLVED] How do I count occurences in a date range?
    By Jeremy in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  7. [SOLVED] How do I count occurences in a date range?
    By Jeremy in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  8. Date Subtraction/Time between Occurences
    By Losse in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-15-2005, 01:32 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