+ Reply to Thread
Results 1 to 15 of 15

Give a distinct sequence number for every data type in Col A and Col B

  1. #1
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    347

    Give a distinct sequence number for every data type in Col A and Col B

    Hi,

    I am trying to get sequence number in Cell G6 based on input data in G1 (the data for these cells is in Col A).

    Formula I using in G6 is
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    However, now I am adding additional column (Col B) and additional Cell G2. Now I want sequence number in G6 based on these two cells (G1 and G2).


    Please see the attached workbook for clear understanding.
    I have added column C (typed manually) for understanding my need i.e., what sequence no should I get in G6.

    Ref Image.jpg
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,987

    Re: Give a distinct sequence number for every data type in Col A and Col B

    Still using Excel 2016?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,987

    Re: Give a distinct sequence number for every data type in Col A and Col B

    This doesn't seem to have anything at all to do with FREQUENCY. Maybe:

    =INDEX($C$2:$C$60,MATCH(1,($A$2:$A$60=G1)*($B$2:$B$60=G2)))

    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).

  4. #4
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    347

    Re: Give a distinct sequence number for every data type in Col A and Col B

    Hi,

    I am currently using 2021.

    In the given formula you are referring to Col C, but Col C doesn't exist in my original data. I have only inserted for reference only. Moreover when I have changed data in G1 or G2 it is not giving desired result.

  5. #5
    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,215

    Re: Give a distinct sequence number for every data type in Col A and Col B

    Explain how you get 5 as there are only 2 entries with the given date and type you specified


    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,987

    Re: Give a distinct sequence number for every data type in Col A and Col B

    Update your profile NOW, please.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,987

    Re: Give a distinct sequence number for every data type in Col A and Col B

    Try this using 2021 functions:

    =LET(u,UNIQUE(A2:B60),s,SEQUENCE(ROWS(u)),XLOOKUP(G1&G2,INDEX(u,,1)&INDEX(u,,2),s))
    Attached Files Attached Files
    Last edited by AliGW; 04-14-2024 at 03:52 AM. Reason: Workbook added.

  8. #8
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    347

    Re: Give a distinct sequence number for every data type in Col A and Col B

    I got 5 because I am taking sequence numbers from A2 (I am considering the previous data values also).

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,987

    Re: Give a distinct sequence number for every data type in Col A and Col B

    That's what post #7 does - have you looked at it?

  10. #10
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    347

    Re: Give a distinct sequence number for every data type in Col A and Col B

    It Worked. But I want to incorporate this in my original data which is a table so how to use Unique.

    A2B60 are in a table called OPMSDUMP and their headers are "INVOICE DATE (DD-MM-YYYY)]", "INVOICE TYPE".

    G1 is assigned name as "EOFFICEDATE"; G2 as "INVOICETYPE"

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


    This doesn't seem to work.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,987

    Re: Give a distinct sequence number for every data type in Col A and Col B

    Provide a more realistic sample datset and I'll have a look.

    However, this should be marked as SOLVED as the original question has been asnwered. You are shifting the goalposts, so this is a tweak.

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  12. #12
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    347

    Re: Give a distinct sequence number for every data type in Col A and Col B

    Oops. Sorry for the tweak. Now I modified and it worked. Thanks for all the help that too promptly and precisely.

  13. #13
    Registered User
    Join Date
    02-29-2024
    Location
    EGYPT - Cairo
    MS-Off Ver
    MS365
    Posts
    88

    Re: Give a distinct sequence number for every data type in Col A and Col B

    Already rejected by the OP.

    In H6
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This will give you 5.
    Last edited by MohamedGadAllah; 04-14-2024 at 08:15 AM. Reason: Already rejected
    Thank,
    Mohamed GadAllah

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,987

    Re: Give a distinct sequence number for every data type in Col A and Col B

    See post #3 - already suggested hours ago and rejected.

  15. #15
    Registered User
    Join Date
    02-29-2024
    Location
    EGYPT - Cairo
    MS-Off Ver
    MS365
    Posts
    88

    Re: Give a distinct sequence number for every data type in Col A and Col B

    Oh, I did not realize that, I've just checked the thread and the OP profile that he was using in 2016.
    To tell the truth, I used to feel that asking members for which version of Excel was being used was not important, but when I was in the exact situation I've realized how much important it is, you are right
    Thanks, Ali

+ 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. Replies: 3
    Last Post: 05-26-2020, 02:46 AM
  2. In different Filters distinct values give a count in the last row.
    By chakkaravarthy.m in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 01-15-2019, 07:36 AM
  3. [SOLVED] VBA to count number in column and give number sequence in next column
    By saravanan1981 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2016, 09:38 AM
  4. Replies: 7
    Last Post: 06-08-2015, 08:39 AM
  5. [SOLVED] To give numbers in sequence
    By SParikh in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-12-2014, 08:49 AM
  6. Replies: 2
    Last Post: 05-15-2010, 07:44 AM
  7. [SOLVED] How to give escape sequence in Excel string literals...
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-09-2005, 03: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