Add 0 before month 1 to 9?

  • Thread starter Thread starter Cam
  • Start date Start date
C

Cam

Hello,

I am not sure how to use the formula or function that CONCATENATE two fields
based on a IF function.
If the month field is 1 to 9, then add 0 before the month, then concatenate
the year & month.
Example Data:
Year Month Concatenate Result
2007 3 2007, 03
2007 4 2007, 04
2008 12 2008, 12
2008 6 2008, 06
2009 10 2009, 10
 
insert a "helper" column by the month and make it =RIGHT("0" & B2,2) and that
will pad the month.
 
If the Year is in column A and the Month is in column B, try in column C:

=A2&", "&IF(B2<10,"0"&B2,B2)

Hope this helps,

Hutch
 
another way to do it as

just select the cells, and go to format, custom and type 00, press ok
that should work too.
 
Another possibility
In C2 copied down
=IF(B2>9,A2 & ", " & B2,A2 & ", " & "0" & B2)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

FORMULA NEEDED FOR MONTHS 1
formula to check the date sequence in rows 3
Excel Jululian 5
SUMIF Formula Help 8
monthly & quarterly Summery 6
Value of prepayment 2
Need Help with this 2
Pivot table problem 4

Back
Top