+ Reply to Thread
Results 1 to 3 of 3

User Defined Function To Add A Zero In A Concatenated Formula

  1. #1
    Registered User
    Join Date
    09-23-2012
    Location
    Banbury, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    User Defined Function To Add A Zero In A Concatenated Formula

    Good Morning Team

    For the life of me I have no idea how to do this or even if it is possible.

    I have this formula

    IF(LEN(F4/4)-FIND(".",F4/4)=1,F4/4&"0",F4/4)

    which I use to add a 0 to a value that would normally end in for example ".2".

    I would like to create a User Defined Function that I could just pass the values, or cells and values to it, and it would produce the required result.

    The reason I want this is due to I am using the Concatenation feature to build up a statement.
    something like this.

    ="Some text "&C5&" some more text "&D12/2&" Total = £ "&F23

    Now you will know that if the values in the cells within the above formula end up as for example £5.20, they will be displayed as £5.2

    To make it look and read better, I want to add the "0", but only need to add the zero if needed. So values like £5.22 would not need the zero added,

    Hope all that makes sense, and any help would be appreciated.

    Many thanks

    BanburyS

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: User Defined Function To Add A Zero In A Concatenated Formula

    You should just be able to use the TEXT function:

    ="Some text "&C5&" some more text "&D12/2&" Total = " & TEXT(F23,"£0.00")

  3. #3
    Registered User
    Join Date
    09-23-2012
    Location
    Banbury, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: User Defined Function To Add A Zero In A Concatenated Formula

    Hi Andrew

    Many thanks for taking the time to reply.

    Blindingly obvious when you know how. I have never really thought of using the TEXT Function.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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