+ Reply to Thread
Results 1 to 13 of 13

Formula to pull data from a chart based on a certain lookup value...

  1. #1
    Registered User
    Join Date
    07-30-2013
    Location
    New Jersey, US
    MS-Off Ver
    Excel 2010
    Posts
    33

    Formula to pull data from a chart based on a certain lookup value...

    Hello. I have a set of data with about 10,000 lines of data. I am working with insurance rates and the year that the rate was issued. Each line has a year value as well as a dollar value in a different cell. On a separate tab I have all the rates for each year and text values adjacent to the rates. For example:

    2010
    -660 Outbound
    -320 Outbound
    50 Inbound
    60 Inbound
    135 Outbound
    165 Outbound

    2011
    -675 Inbound
    -660 Outbound
    -320 Inbound
    50 Inbound
    61.5 Outbound

    On the other tab that has my 10,000 lines of data, I want to create a formula for each line that will take the year that the rate was issued, and than lookup the insurance rate in the table that corresponds to that year. But I want the formula to tell me if the rate is either Inbound or Outbound.

    So in summary, the 10,000 lines of data will look something like this:

    Column A (Insurance Rate): -660
    Column B (Issue Year): 2011
    Column C (Inbound/Outbound): This is where I would want the formula

    *Keep in mind that the rates are broken out by Issue Year on a separate tab like I showed above.

    Any thoughts?

    -Garrett
    Last edited by gmazz; 04-23-2014 at 10:05 AM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Formula to pull data from a chart based on a certain lookup value...

    Assuming on sheet2 you have the number values in col A from lowest and inbound/outbound in B
    With year in B2
    =VLOOKUP(A2,INDEX(sheet2!$A$2:$A$100, Match(B2, Sheet2!$A$2:$A$100, 0)+1):INDEX(Sheet2!$B$2:$B$100, MATCH(B2+1, Sheet2!$A$2:$A$100,0)-2),2)
    Does that work for you?
    An example workbook might help (go Advanced>Manage Attachments)
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    07-30-2013
    Location
    New Jersey, US
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Formula to pull data from a chart based on a certain lookup value...

    Chemist the attachment is too large. Could I send it to you via e-mail? Or do you know of a better way to allow you to access it?

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Formula to pull data from a chart based on a certain lookup value...

    Just make a copy with enough data so we can see what you are trying to do. Remove the extra data and sheets that don't relate to the problem. Try zipping the file also.

    Were you able to understand the formula that I presented? I assume it didn't work if you want to upload the sheet.

  5. #5
    Registered User
    Join Date
    07-30-2013
    Location
    New Jersey, US
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Formula to pull data from a chart based on a certain lookup value...

    I have attached an example and removed most of the lines of data but left enough so you could work with it.

    Column X refers to the Issue Year
    Column S refers to the Insurance Rate

    The tab labeled "Lookup Table" is where you can find the tables broken out by year.

    I am looking to create a formula for Column Y and Column Z.

    Does this help at all?

    I appreciate you working with me to help solve this problem.

    -Garrett
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Formula to pull data from a chart based on a certain lookup value...

    I inputted my formula into X and Y (similar to what I suggested in Post #2). Let me know if it is returning the correct values and if not, which ones and what did you expect for those.

    Edit: Note, I added the year 2015 to the bottom of your Lookup Table. The formula defines the boundaries of what it is looking up by the year and next year so would cause an error when there is no next year.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-30-2013
    Location
    New Jersey, US
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Formula to pull data from a chart based on a certain lookup value...

    Thank you for playing around with this.

    My original attachment used vlookups that I had to change the arrays to match each Year on the Lookup Table tab.

    I have attached a revised version where I pulled the values from the original attachment and added them next to the columns that you added your formulas into. In columns AA and AC you will see either a 1 or a 0. If it shows a 0, than it means that your formula returned a value that differed from my original attachment. The original attachment is accurate and I can continue to work this way but I was hoping to use one formula to make things easier.

    Any thoughts as to why your formula was returning a different value?

    -Garrett
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Formula to pull data from a chart based on a certain lookup value...

    Typo on my part. I had put a D2 instead of a D6

    Correct formula (dragged down) in Y3

    =VLOOKUP(S3,INDEX('Lookup Table'!$A$6:$A$100, MATCH(X3, 'Lookup Table'!$A$6:$A$100, 0)+1):INDEX('Lookup Table'!$D$6:$D$100, MATCH(X3+1, 'Lookup Table'!$A$6:$A$100,0)-1),2)

  9. #9
    Registered User
    Join Date
    07-30-2013
    Location
    New Jersey, US
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Formula to pull data from a chart based on a certain lookup value...

    Thank you sooooo much it works perfectly! I wish I knew how you did this haha. So what would I need to change in order to make the formula work for column Z (where it will return the Term from the Lookup Table tab)?

    -Garrett

  10. #10
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Formula to pull data from a chart based on a certain lookup value...

    Just change that final 2 (returning from column 2) to a 3 (returning from column 3)
    Glad to help

  11. #11
    Registered User
    Join Date
    07-30-2013
    Location
    New Jersey, US
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Formula to pull data from a chart based on a certain lookup value...

    Thank you again for helping me understand what you did. Last question for you... I will be updating the lookup table charts regularly. Will this formula continue to work when I add a new year of data in the lookup table? I understand that if I add to the tables, that if I go past row 100, than I will need to adjust the arrays. Assuming I adjust the arrays accordingly, will it always function properly?

  12. #12
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Formula to pull data from a chart based on a certain lookup value...

    You will always need to put the next year after your last row (that's how it knows where to end). Other than that (and the proper range) yes, it will work.

  13. #13
    Registered User
    Join Date
    07-30-2013
    Location
    New Jersey, US
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Formula to pull data from a chart based on a certain lookup value...

    Perfect. Thank you so much Chemist!

    -Garrett

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Formula pull factor from chart based on value of diff field?
    By Anne Troy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 07:05 AM
  2. Formula pull factor from chart based on value of diff field?
    By Anne Troy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 06:05 AM
  3. Formula pull factor from chart based on value of diff field?
    By Bill R in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  4. Formula pull factor from chart based on value of diff field?
    By Bill R in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  5. [SOLVED] Formula pull factor from chart based on value of diff field?
    By Bill R in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1