Excel/excel formatting
Expert: Richard Roberts - 2/7/2006
Question-------------------------
Followup To
Question -
Hello RICHARD,
I'm running Office 2003. In Excel, if someone sends me dates that are formatted in this manner: 20041225 (year, month, date) is there a way to convert this to look like 12/25/2004. I need to do this on a large scale. I would hate to have to do this one cell at a time.
Any help would be grateful!
Answer -
Jerry
Since the formatting that you have, 20041225, isn't an accepted date format in excel 2003, we won't simply be able to reformat the cells to the 12/25/04 date format. However we can use a methods to change the numbers so that they are in an acceptable date format.
First--you can use text to columns to separate the number into 4 columns, with 20 in the first column, 04 in the second column, 12 in the third column, and 25 in the fourth column.
Second you can then use a concatenate type formula to reassemble the number the way you want it to look. for example.
=+C1&F1&D1&F1&G1&B1
Here is what we did
Used text to columns on the number as input into cell A1 to separate the number into 4 columns they were 20,4,12,25
in columns A,B,C,D respectfully. Go to toolbar/text to columns/pick fixed width in the next window and click where you want the number separated then clic next, then clic finish. This will separate the number, and you can do a wholde column of numbers at once.
Then use the formula
=+C1&F1&D1&F1&G1&B1
to put them back together in the order you want. Note that in cell F1 I placed the backslash '/ and in cell G1 I placed a zero. The zero will have to be added back in front of the 4, because it is lost when converted to columns.
Hope this helps.
Richard
Richard,
Thanks for your help. It work!
I have one more question if you don't mind. When I use the RANDBETWEEN function with a number range between 1-50 I get the same numbers twice. Is there a way to seteup that function so I only get a random number once
AnswerJerry
If you are using the RANDBETWEEN() function I don't know why you would be getting the two random numbers. As far as I know it should only produce one. If you are using the
Random number generator in the data analysis toolpak it can generate 1 or multiple random numbers. The second box in the drop down menu asks for the number of random numbers you want. if you are using this method and have put 2 in the box it will generate two random numbers.
Hope this helps.
Richard
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your
Excel question answered in this area then please ask an Excel question here