Forum Discussion

JacobSanchez11's avatar
JacobSanchez11
Copper Contributor
Feb 23, 2024

Leading Zeros

I am attempting to CONCAT the two cells as seen below, however, when I CONCAT it will drop the leading zero from the second cell when I need it to remain to show as 1300 instead of 130. How can I keep it from dropping the zero?

 

  • bosinander's avatar
    bosinander
    Steel Contributor
    From the look of the labels, You may also switch to date and time-values by having AO2
    =TIME(0, AM2, AN2)
    and format AO as mmss (ctrl+1, Custom, Type).
    You will thereby have the requested look, also with leading zero on the minutes if needed, and the possibility to calculate with the results. eg MAX, MIN, AVG of column AO as well as doing charts
  • office970549's avatar
    office970549
    Copper Contributor

    JacobSanchez11 Hi, im not sure how you add that leading zeros in AN columns, difference ways of adding it will have difference outcome, if you are using number format to add it, the value of the cell is actually the value you typed in.
    Here are some difference way to add leading zeros:
    https://excelchamps.com/formulas/leading-zeros/
    My suggestion is:
    - Format the column's number as text (this way, the 0 you type infront wont disappear)
    - Or if you want to type in single digits and it shows double digits, you could add a column next to AN to convert the value in AN to text using

    =TEXT(AN2,"00")

    And then the column where you want the joined result

    =CONCAT(AM2,AO2)

    And hide the AO columns

     

Resources