Ask questions via twitter! Message any question to @answers on twitter. We'll publish the question and send you a reply each time there's a new answer.
Next Question

Question

 
M$2 January 09, 2009 08:59 PM

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?
Interesting Question?  Yes (0)   No (0)   
Email to a friend | RSS
 
 

 
   No Best Answer Selected, Tip Refunded
 
 


Answers (5)

Sort By
 
January 09, 2009 09:18 PM
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. :)


Helpful Answer?  (0)   (0)    Tip lfnovo for this answer
Permalink | Report
   Reply  
 
 
 
January 09, 2009 11:35 PM
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
 
 
 
January 09, 2009 09:19 PM
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.

Helpful Answer?  (1)   (0)    Tip themshow for this answer
Permalink | Report
   Reply  
 
 
 
January 09, 2009 11:32 PM
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
 
 
 
January 09, 2009 11:37 PM
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
 
 
 
January 10, 2009 01:36 PM
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.

Report
 
 
 
January 09, 2009 09:47 PM
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
Source(s):
http://en.wikipedia.org/wiki/Pivot_table


Helpful Answer?  (0)   (0)    Tip voodojoe for this answer
Permalink | Report
   Reply  
 
 
 
January 09, 2009 10:11 PM
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.


Helpful Answer?  (0)   (0)    Tip gregdmetcalf for this answer
Permalink | Report
   Reply  
 
 
 
January 09, 2009 11:32 PM
See my comments to Ifnovo; your answer might have something to it but frankly I don't quite understand how to apply it.

Report
 
 
 
January 10, 2009 12:17 AM
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.

Report
 
 
 
January 10, 2009 12:35 AM
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
 
 
 
January 10, 2009 01:04 AM
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.

Helpful Answer?  (0)   (0)    Tip ilaksh for this answer
Permalink | Report
   Reply  
 
 
Buy Mahalo Dollars with Credit Card or PayPal

Top Members

This Week All Time
  • buddawiggi
    buddawiggi
    2nd Degree Black Belt
    26427 Points
    M$771.39 Earned
  • kty2777
    kty2777
    Purple Belt with a Brown Tip
    5138 Points
    M$193.66 Earned
  • opher
    opher
    Purple Belt
    3659 Points
    M$149.42 Earned
   See All
 

Most Popular Tags

mahalo(1553)
iphone(459)
music(458)
google(346)
food(308)
online(286)
beer(275)
money(261)
movies(248)
apple(247)
aotd(235)
health(215)
video(200)
free(200)
dog(200)
   See All
 

Categories

Welcome New Members


 
 
Mahalo Dollars are the currency of Mahalo Answers.

Each Mahalo Dollar costs $1.

Once you earn more than 40 Mahalo Dollars, you can request to be paid via PayPal. Each Mahalo Dollar is currently worth $0.75 when paid out via PayPal. Learn More

 
 

Please log in to use this function.