electricbrain's Avatar
electricbrain 4
8 Asked
36 Answered
7 Best
0
No one has voted on this question yet :(
3 years, 4 months ago

How to convert a spreadsheet with years as rows and months (Jan-Dec) as columns into YYYY-MM columns only

Suppose a spreadsheet where the leftmost column has years from 1948 to 2008. The topmost row has months January to December.

What I'd like to know is a clever way to convert this data, without programming, into a YYYY-MM columns from Jan 1948 to Dec 2008, with the data values in one row under each appropriate month.

What's the best way to do this?
Tip for best answer: M$2.00
Separate topics with commas, or by pressing return. Use the delete or backspace key to edit or remove existing topics.

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

What is Your Answer?

0
0
0

5 Answers

1
themshow's Avatar
themshow | 3 years, 4 months ago
4
You might have a problem right out of the gate, Excel 2003 only supports 256 columns per worksheet, you're going to have 600. More importantly, why are you trying to do this - for a graph? This makes the data more difficult to manage.

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$
electricbrain's Avatar
electricbrain | 3 years, 4 months ago Report

Your approach arrives at the wrong answer faster than mine, which deserves some honorable mention, but unfortunately it doesn't arrange them in single series columnar format which is my objective. It arranges the dates row-by-row, in dozens, instead of as one continuous set of adjacent columns (proceeding from January 1948 at A1 until December 2008 at An). Hope this makes sense.

themshow's Avatar
themshow | 3 years, 4 months ago Report

So where are you mixing the data? Still in a spreadsheet? It would be easier to write a formula that can pull from an x/y chart rather than stringing the chart out.

electricbrain's Avatar
electricbrain | 3 years, 4 months ago Report

Sorry--my first reply was meant for Ifnovo.

I'm using OpenOffice actually, but I can live with an Excel solution if that's provided. They are pretty comparable in most cases.

I want to serialize data that I currently have in an X-Y format. Specifically, it is the Bureau of Labor Statistics unemployment figures, which are delivered in an X-Y chart from the BLS Web site (with years as the row labels and months as the column identifiers). I would like to translate this into serialized unemployment rate per month so that I can mix the data with other month-pegged data to do some comparisons and contrasts.

Report Abuse

Post Reply Cancel
0
ilaksh's Avatar
ilaksh | 3 years, 4 months ago
4
If you are going to run out of columns like he says then you are just going to run out of columns and there isn't anything we can do about that. You can convert some of the data into your format until you run out of columns. Maybe analyzing the most recent ten years of data or something will be useful.

Anyway, you can look at this as two problems:

1) Get all of the data arranged on one row instead of 60.
-- one way to do this is 60 cut/copy and paste operations. Boring, but definitely will solve the problem. I think a key combination like End-right arrow or control-right arrow may help you position the cursor at the "edge" of the data (at least for Excel).

Another way to do this would be to use CELL("value", range) to lookup the value where you would basically divide the column number (e.g. column("A5")) by 12 to get the row number. The problem with this, besides being a difficult formula is that it does require programming because amazingly there isn't any way to specify a cell based on row and column number (in a regular formula) and in order to convert column numbers into column letters you need a VBA function http://www.freevbcode.com/ShowCode.asp?ID=4303 .

2) Properly label each column according to YYYY-MM.
-- The simplest thing to do would be to copy these values from the worksheet generated by lfnovo.


Down the line if you want to keep analyzing the data, Pivot Tables or OLAP might be helpful. If you can get the data into MS Access then I think you can use Excel's OLAP features with Access. Certainly you can do that with SQL Server.

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

Report Abuse

Post Reply Cancel
0
voodojoe's Avatar
voodojoe | 3 years, 4 months ago
4
Yeah it sounds like what you want is a Pivot Table. which you can get MS Excel to do pretty easily.
http://en.wikipedia.org/wiki/Pivot_table

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

Report Abuse

Post Reply Cancel
0
lfnovo's Avatar
lfnovo | 3 years, 4 months ago
4
The way I would do it is:

1-) Instead of months, use the month numbers, like 1 for January and so on.

Then, use this formula

=CONCATENATE($A5,"-",RIGHT("0" & B$4,2))

Where A5 is "1948" cell and B4 is "1" cell (for January). Then, just apply the formula to the other cells and this should work fine. This will also take care of the leading zeros, so it will show: "1948-01" as you wanted.

Here is the link of the file that I did as an example:
http://www.yousendit.com/download/WnBTZEV5OC83bUJMWEE9PQ
source(s):
I just know. :)

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$
electricbrain's Avatar
electricbrain | 3 years, 4 months ago Report

Your approach arrives at the wrong answer faster than mine, which deserves some honorable mention, but unfortunately it doesn't arrange them in single series columnar format which is my objective. It arranges the dates row-by-row, in dozens, instead of as one continuous set of adjacent columns (proceeding from January 1948 at A1 until December 2008 at An). Hope this makes sense.

Report Abuse

Post Reply Cancel
0
gregdmetcalf's Avatar
gregdmetcalf | 3 years, 4 months ago
4
As themshow said, if you have enough cols, this is what I would use.

=INDIRECT(ADDRESS(P$5+P$7,P4+P$6))

picture here: http://twitpic.com/117rz

green areas I assume you can easily populate out.
source(s):
just me.

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$
electricbrain's Avatar
electricbrain | 3 years, 4 months ago Report

See my comments to Ifnovo; your answer might have something to it but frankly I don't quite understand how to apply it.

gregdmetcalf's Avatar
gregdmetcalf | 3 years, 4 months ago Report

I will post a video when I get home (faster connection),and you can use the formula [=IF(AVERAGE(O2:Z2)=Z2,Z2+1,Z2) to get your row of years populated across all the columns. For example, if you at least make 12 columns of value "1948" starting at cell"O2" than the 13th column put that formula and copying all they way out.

gregdmetcalf's Avatar
gregdmetcalf | 3 years, 4 months ago Report

I guess I could have just put the example xlsx file somewhere for you too.

http://cid-8a0f84dc4bf39da9.skydrive.live.com/self.aspx/Public/Book2.xlsx

Report Abuse

Post Reply Cancel

Learn something new with our FREE educational apps!

Private lessons in the comfort of your own home. Get back in shape or finally pick up a guitar with our great experts guiding you the whole way!
Learn Guitar
Learn Hip Hop
Learn Pilates