+ Reply to Thread
Results 1 to 11 of 11

Excel Formula for creating a Batch Number

  1. #1
    Registered User
    Join Date
    11-05-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    25

    Excel Formula for creating a Batch Number

    Hi,

    I have to create a continuous batch number for every product (for a Given Date)
    - i.e. All Receipts of One Product in Same Day is ONE Batch .

    Example and conditions are shown below.
    - Result in Column 'C'
    - Guideline is in Column 'D'


    Please help me to create a formula or macro.
    Batch Number.png

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 365
    Posts
    2,406

    Re: Excel Formula for creating a Batch Number

    For Column C, put in C2 and copied down

    =DAY(B2)

    For COlumn D is difficult with formula because its merged column

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Excel Formula for creating a Batch Number

    Please upload a sample of your workbook, not a picture of your data. Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you
    Also, not all members can upload picture files (Company firewalls and stuff) - and, depending on what browser is being used, some pics dont even show up on the forum

    Your workbook should show a small desensitized example of the data you are working with and a manual mockup of the expected results.
    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
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    11-05-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Excel Formula for creating a Batch Number

    Hi,

    a) What I need a batch number. But not the day.
    One Batch Number for One Product
    b) The output expected is entered manually in COLUMN 'C' . But need a formula for it.

    Please refer to the Excel attached for reference.
    http://www.excelforum.com/attachment...1&d=1460444731

    Regards,

    B.Srinivasa Rao
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-05-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Excel Formula for creating a Batch Number

    Hi,

    a) Please refer to the Excel attached for reference.
    http://www.excelforum.com/attachment...1&d=1460444731

    What I need a batch number.
    One Batch Number for One Product

    b) The output expected is entered manually in COLUMN 'C' . But need a formula for it.

    Thanks in advance.

    B.Srinivasa Rao

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Excel Formula for creating a Batch Number

    1st, you should remove those merged cells, they cause problems with formulas.
    2nd, Im not where where you get those dates in column D, they are not the dates from column B?

    This will pull out the info the way you show it...
    =IF(A1&"-"&B1&"-"&C1=A2&"-"&B2&"-"&C2,"","Material "&A2&" - Batch "&C2&" Received on "&TEXT(B2,"dd.mm.yy"))

  7. #7
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,179

    Re: Excel Formula for creating a Batch Number

    Try this in Cell C2:

    =SUMPRODUCT(($A$2:A2=A2)/COUNTIFS($A$2:A2,$A$2:A2,$B$2:B2,$B$2:B2))

    Copy down

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Excel Formula for creating a Batch Number

    Phuocam that does not include the text or date, as the OP showed in their sample answer

  9. #9
    Registered User
    Join Date
    11-05-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    25

    Thumbs up Re: Excel Formula for creating a Batch Number

    Quote Originally Posted by Phuocam View Post
    Try this in Cell C2:

    =SUMPRODUCT(($A$2:A2=A2)/COUNTIFS($A$2:A2,$A$2:A2,$B$2:B2,$B$2:B2))

    Copy down
    THANK YOU.

    The formula worked well.

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Excel Formula for creating a Batch Number

    looks like I mis-read the question in your 1st post - apologies

  11. #11
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,179

    Re: Excel Formula for creating a Batch Number

    Quote Originally Posted by seenai View Post
    THANK YOU.
    The formula worked well.
    You're welcome.

+ 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. Creating a macro to generate batch emails from a list of addresses in excel file
    By maccabarra in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2015, 02:59 PM
  2. [SOLVED] Creating Unique Batch or Lot Numbers
    By jacob@thepenpoint in forum Excel General
    Replies: 4
    Last Post: 06-05-2015, 07:16 PM
  3. Creating and running batch files from vba
    By Cordin90 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2015, 02:35 PM
  4. Creating a batch of 100 sheets to excel
    By s7v7n38 in forum Excel General
    Replies: 4
    Last Post: 12-05-2014, 01:59 PM
  5. creating batch files for each item in combobox
    By bg_enigma1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-27-2012, 04:54 PM
  6. [SOLVED] Batch creating multiple .txt files and with search and replace
    By kevenson in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-28-2012, 12:25 PM
  7. [SOLVED] Formula to round down on a batch and exclude anything under a full batch
    By toomuchbrew in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-15-2012, 11:04 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