Solved

Excel Formula

Posted on 2015-01-17
3
106 Views
Last Modified: 2015-01-17
I have a spreadsheet of dates and values that I need to perform a lookup on. Here is my data structure:

Column B - dates in Ascending order
Column J - numeric values

My problem is that I can't perform a standard lookup where I have a known value in column b that will return a value from column j. The lookups that I need to perform are based on calendar years. So for example, in the attached spreadsheet if I were doing my lookup for 2013 value I need returned is $35,904.58, if I were doing my lookup for 2014 the value I need returned is $34,589.33.

So what I need is a formula that will look for the maximum date in column b for a given year, and then return the value in the corresponding position in column j.
1098TestFormulas.xlsx
0
Comment
Question by:gacto
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 18

Expert Comment

by:Simon
ID: 40555273
Please see attached with the formulae for each year added below the original data.
1098TestFormulas-V1.xlsx

This uses a combination of an array formula in one cell to determine the max date value within the year, and the MATCH and INDIRECT functions in a second cell to return the relevant value from column J.

This is the array formula (which will return an error if not entered as an array formula using CTRL+SHIFT+ENTER on Windows or CMD+SHIFT+ENTER on Mac). The formula will have curly braces around it if it is an array.
=MAX(IF(YEAR($B$1:$B$24)=A29,$B$1:$B$24))

This is the formula that goes next to it and refers to it to locate the correct value in column J.
=INDIRECT("J"&MATCH(B29,$B$1:$B$24,0))
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 40555303
You can also use this formula in e.g. L (doesn't matter) to get the most recent value of the corresponding year:
  =VLOOKUP(DATE(YEAR(C:C)+1,1,1),C:J, 8)
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 40555305
You can use a relatively simple LOOKUP formula, e.g. if you put the years in L2 down then you can use this formula in M2 copied down

=LOOKUP(DATE(L2,12,31),B$1:J$24)

By looking up the last day of the year in a sorted list of dates you will always get the latest date in that year, and the LOOKUP finds the corresponding value in column J

see attached

Edit: Hey Qlemo! Sorry, didn't see your reply when I replied, our approaches are very similar.....!

regards, barry
Lookup-dates.xlsx
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question