+ Reply to Thread
Results 1 to 3 of 3

Making an 11 digit reference number that combines a date and a dollar amount,.

  1. #1
    Registered User
    Join Date
    11-21-2021
    Location
    Pittsburgh, PA
    MS-Off Ver
    365
    Posts
    2

    Making an 11 digit reference number that combines a date and a dollar amount,.

    Hello,

    I tried to come up with a nested formula that combines a deposit date and deposit amount into an 11 digit number. The given deposit date (Cell A2) is in mm/dd/yyyy. It needs to be converted into mmddyy format (6 digits) where the decade year is a zero no matter what. The dollar amount needs to have the decimal point removed and trailing zeros added if necessary to make the remaining 5 digits.

    Examples:

    Deposit Date: 05/21/2021, Deposit Amount: $1,234.56, Reference Number: 05210112345

    Deposit Date: 11/21/2021, Deposit Amount: $504.21, Reference Number: 11210150421

    Deposit Date: 12/01/2020, Deposit Amount: $10.24, Reference Number: 12010010240

    Deposit Date: 01/20/2022, Deposit Amount: $5.67, Reference Number: 01200256700

    Deposit Date: 05/22/2023, Deposit Amount: $0.05, Reference Number: 05220350000

    I made a crazy sloppy macro that used many helper columns of single formulas that removed the brackets from the dates and made the decade portion of the yy a zero, highlighted the date column to change the format to mmddyy format, multiplied the Deposit Amount by 100 to removed the decimal point, add trailing zeros if necessary, and concatenate the results. My results were ok, but for any amounts $9.99 or less, the resulting reference number had to have one or more zeros added to make the 11 digits.

    Was just hoping there was an amazing nested formula out there that could do the reference number making in one step.

    Thanks.

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,907

    Re: Making an 11 digit reference number that combines a date and a dollar amount,.

    Try this:

    =REPLACE(TEXT(A2,"mmddyy"),5,1,0)&LEFT(B2*1000000,5)
    Last edited by Phuocam; 11-21-2021 at 07:32 PM.

  3. #3
    Registered User
    Join Date
    11-21-2021
    Location
    Pittsburgh, PA
    MS-Off Ver
    365
    Posts
    2
    [QUOTE=Phuocam;5597548]Try this:

    =REPLACE(TEXT(A2,"mmddyy"),5,1,0)&LEFT(B2*1000000,5)[/QUOTE)

    Thank you so much! The formula is beautiful! You’re a Rock Star!

+ 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. Adding totals by matching number and dollar amount
    By thorray in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-05-2021, 09:58 PM
  2. Alpha Dollar amount based on numeric dollar amount
    By nickpavlov in forum Excel General
    Replies: 1
    Last Post: 10-18-2019, 06:42 PM
  3. Replies: 3
    Last Post: 05-08-2019, 02:47 PM
  4. [SOLVED] How can I distribute a dollar amount into an odd number of rows?
    By cliff.clayman in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-31-2016, 09:36 PM
  5. Replies: 4
    Last Post: 09-14-2011, 06:23 PM
  6. How to make a single number equal a dollar amount in next cell?
    By mrphotoguy1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-05-2010, 06:11 PM
  7. Replies: 3
    Last Post: 05-18-2005, 09:06 PM

Tags for this Thread

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