简体   繁体   中英

How to: Aligning data on different time intervals in Excel

I'm looking to compare data that is from different time interval. I'm an Economics student and I'm trying to compare data that is released monthly and data that is released yearly. Specifically how the number of jobs created in a given month influences the GDP figure.

I'm neither allowed to post images or enough links with my current reputation so here's my beautiful collage to illustrate what I'm asking:

http://s22.postimg.org/jpspa1pvl/Screenshots.jpg

  1. The frequency is different. The NFP (Jobs created) are released monthly, GDP is released yearly.

  2. I'm wanting the GDP numbers to go at the start of the corresponding year. This is where I was having problems with VLOOKUP. I could't get it to align correctly or not repeat itself.

  3. An illustration of the graph I'm after.

EDIT: To make it clearer

http://s15.postimg.org/qcg70u5aj/Screenshots1.jpg [ignore the graph]

Here's what I'm looking for without the dodgy formatting. So the first screenshot is the data. And the second is what I'm looking for.

The GDP data is released on the September each year, but it details the entire year of GDP growth. So I want compare it with the Job Figures (that are released monthly). So there will be 12 Job Figures (NFP) to each GDP figure. Thanks.

PS: Sorry if there's similar questions. I don't know what keywords to search to get the answer.

I set up a sample worksheet as follows:

  1. Column A, from Row 5 to 57 has dates: firsts of consecutive months 1/1/80, 2/1/80 etc
  2. Column B, from Row 5 to 57 has random numbers for Non-Farm Payroll
  3. Column D, from Row 5 to 17 has dates: Sep 30 of consecutive years 9/30/80, 9/30/81 etc
  4. Column E, from Row 5 to 17 has random numbers for Annual GDP

Then I did this:

  1. Column C, from Row 5 to 57: I added the formula =IF(AND(DAY(A5)=1,MONTH(A5)=1),VLOOKUP(DATE(YEAR(A5),9,30),$D$5:$E$17,2,FALSE),"")

Explanation If the date in column A is the first of Jan (of any year), look up the 30th of Sep of same year in the GDP table and pick up the corresponding GDP value from the second column of that table ($D$5:$E$17). If not, leave the cell empty

Note Once you have this modified to suit your purpose, you might want to copy those cells in Column C and do a paste-special (Alt-E, S) of them right back in the same place, pasting only the values so that the formulae are gone and you're not tied down to the GDP table.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM