Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Cam Cam is offline
external usenet poster
 
Posts: 165
Default Add 0 before month 1 to 9?

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
dlw dlw is offline
external usenet poster
 
Posts: 510
Default Add 0 before month 1 to 9?

insert a "helper" column by the month and make it =RIGHT("0" & B2,2) and that
will pad the month.

"Cam" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.misc
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



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,069
Default Add 0 before month 1 to 9?

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

"Cam" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.misc
RAZ RAZ is offline
external usenet poster
 
Posts: 120
Default Add 0 before month 1 to 9?

another way to do it as

just select the cells, and go to format, custom and type 00, press ok
that should work too.

"Cam" wrote:

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



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Add 0 before month 1 to 9?

try

=A2&", "&RIGHT("0" &B2,2)

Mike

"Cam" wrote:

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

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Add 0 before month 1 to 9?

=A2&", "&TEXT(B2,"00")
--
David Biddulph

"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



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Add 0 before month 1 to 9?

=a2&", "&text(b2,"00")
or
=text(date(A2,B2,1),"yyyy, mm")



Cam wrote:

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


--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 270
Default Add 0 before month 1 to 9?

Another possibility
In C2 copied down
=IF(B29,A2 & ", " & B2,A2 & ", " & "0" & B2)

"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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel to make the days cary over month to month automaticly GARY New Users to Excel 1 April 19th 08 06:05 PM
Excel 2003 month to month data change grid Chad[_2_] Excel Discussion (Misc queries) 2 February 15th 08 01:36 AM
Number of days in month counted from shortened name of month & yea Tumar Excel Worksheet Functions 6 September 18th 07 03:36 PM
Retrieve data for previous 3, 6, 12 month given current month GB Excel Worksheet Functions 4 July 19th 07 11:58 PM
transfer cell $ amount to other sheet month-to-month without overc Colin2u Excel Discussion (Misc queries) 1 July 28th 05 02:36 AM


All times are GMT +1. The time now is 10:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"