View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Gaurav[_4_] Gaurav[_4_] is offline
external usenet poster
 
Posts: 36
Default Add 0 before month 1 to 9?

=IF(LEN(B1)=1,A1&","&" "&0&B1,A1&","&" "&B1)

hope this helps.


"Cam" wrote in message
...
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