+ Reply to Thread
Results 1 to 10 of 10

Formulae required for serial number

  1. #1
    Registered User
    Join Date
    07-31-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    46

    Formulae required for serial number

    i need ur help for formula for this problem, i have tried myself but still no success

    say example, i need serial number in Column A, e.g 01, 02, 03, 04 and so on but with 2 conditions
    in column B , there are fruits e.g B1 = Apple, B2= Mango, B3=Mango, B4= Apple, B5= Mango
    and in Column C, there r months, e.g , C1= Jan-2013, C2= Jan-2013, C3= Jan-2013,C4 = Jan-2013, C5= Feb-2013
    The result of serial number i want in Column A is A1=01, A2=02, A3=02, A4= 01, A5=03,

    it means, if there is jan-2013 and irrespective of how many times apple come in jan-2013, the serial number must be always 01 and the serial number of new fruit after the first one e.g mango here must be 02, mango is also coming 2nd time in jan-2013, that's why its serial # is again 02 but if the same fruit e.g mango is coming in other month, serial must start in sequence, here mango is coming third time in Feb-2013, now its serial # is 03
    hope u got my point
    plz provide me the formula to solve this problem,
    Thank u so much
    waiting for ur respone

  2. #2
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Formulae required for serial number

    make a vlookup table with Apple and mango in column 1, the starting designation in column 2 then use formula =VLOOKUP(B1,$G$1:$H$2,2,0)+MONTH(C1)-1, where the vlookup is in range G1:H2.

    see example
    example.xlsx

  3. #3
    Registered User
    Join Date
    07-31-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Formulae required for serial number

    Thanks Scott for ur time and effort, i appreciate it, i looked at ur example and found problem in it.
    it is working fine the same way i want but only in starting as i increase fruits and months in vlookup table, the sequence is not in order the way i want. i have attached the same sheet of ur example with more fruits and months, plz have a look at it and see the problem and resolve it with due respect, Thanks
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Formulae required for serial number

    can you put what the sequence should be in column D so I can see what you want it to display? cause it looks fine to me, maybe extend the list a bit more so each fruit has at three months represented

  5. #5
    Registered User
    Join Date
    07-31-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Formulae required for serial number

    as you said, i have attached the same example sheet with more detail and explained in it the result where it is showing wrong along with correction,
    hope now u will get my point, plz have a look at it. Thanks
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-31-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Formulae required for serial number

    main point in all is that, whatever the fruit is, if the fruit is repeated in the same month, the serial must be of the same month of that particular fruit otherwise serial must be in order

  7. #7
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Formulae required for serial number

    sorry your method doesn't make sense to me, apple in jan is 1 but apple in feb is 6 and mar is 7 and it's based on occurance, so if apple comes before mango it would be different than if mango came before apple?

    a serial number should be designed more simply, like first two digit = month, second digit = type (apple, mango...) or something

    a formula might not be the best option if you have a ton of lines because the number of logic steps to get the outcome would be too great, you would need vba to check to see if there are repeats with in a month and to determine order

    I hope someone can help you, i'm not smart enough, best of luck

  8. #8
    Registered User
    Join Date
    07-31-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Formulae required for serial number

    Basically serial number depends on different fruits with different months, no prob Sir Scott, i appreciate for ur precious time and effort, at least u tried it, Thanks a lot for this,

  9. #9
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Formulae required for serial number

    Hello,

    This "might" be done with just formula alone
    Please Login or Register  to view this content.
    But you will have to enter 1 to the first row, then use this Array formula from second row onward.
    When you enter it, hold Ctrl-Shift and hit Enter
    See the sample file attached.
    examples.xlsx
    (copy pasta from Ford)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools

    Regards,
    Lem

  10. #10
    Registered User
    Join Date
    07-31-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Formulae required for serial number

    Thanks Lemice, great, it is working perfectly fine, i really appreciate ur effort n time, thank u so much once again

+ 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.6.0 RC 1