+ Reply to Thread
Results 1 to 6 of 6

How to pull/grab from a chart - Ranged If funion?

  1. #1
    Registered User
    Join Date
    12-21-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    8

    How to pull/grab from a chart - Ranged If funion?

    Normally I just do a really long IF or IFOR function. But this doesn't always work because there is too much information.

    How do I pull from a chart:

    ____A___B __C___D

    1___M1_____M1__5
    2___M1_____M2__4
    3___M3_____M3__7
    4___M2_____M4__6
    5___M3_____M5__8


    So in this simplified case, I need to find the value for cell B1 from the cell A1 - the answer is 5 (shown in D1).

    How do I tell cell B1 to match the cell A1 with a range of C1:C5. Then the answer would be the corresponding cell D.

    An if function would look like this for cell B1:
    =IF(A1="M1", 5)


    I hope this makes sense. The goal here would be to eliminate really long if functions and rather plug in a chart on the side of my work-page. I can then use the chart to pull information from.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: How to pull/grab from a chart - Ranged If funion?

    You can use this in B1:

    =IFERROR(VLOOKUP(A1,C$1:D$5,2,0),"")

    then copy down as far as you need to.

    Hope this helps.

    Pete

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,204

    Re: How to pull/grab from a chart - Ranged If funion?

    Assuming data in column A to C

    in D1

    =INDEX($C$1:$C$5,MATCH($A1,$B$1:$B$5,0))

    Copy down

  4. #4
    Registered User
    Join Date
    12-21-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    8

    Re: How to pull/grab from a chart - Ranged If funion?

    Thanks! The VLOOKUP function was exactly what I needed.

    Just out of curiosity, what is the point in the iferror?

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: How to pull/grab from a chart - Ranged If funion?

    Glad to hear it.

    If any of the cells in column A contain a value that is not in the table (or empty) then the formula would return an error message - the IFERROR part traps that and returns a blank instead. See what happens if you put XYZ in cell A1.

    If that takes care of your original question, please select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  6. #6
    Registered User
    Join Date
    12-21-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    8

    Re: How to pull/grab from a chart - Ranged If funion?

    Quote Originally Posted by Pete_UK View Post
    Glad to hear it.

    If any of the cells in column A contain a value that is not in the table (or empty) then the formula would return an error message - the IFERROR part traps that and returns a blank instead. See what happens if you put XYZ in cell A1.

    If that takes care of your original question, please select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete
    Thank you sir. Very helpful. Time for me to get back to work!

+ 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] Resizing a used ranged name
    By zara_toustra in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-10-2014, 04:52 PM
  2. [SOLVED] VBA Search and Replace With Ranged Name
    By John Vieren in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-27-2013, 11:19 PM
  3. [SOLVED] Using a concatenated string to reference a name ranged for a chart series
    By Snoch in forum Excel Charting & Pivots
    Replies: 23
    Last Post: 08-05-2013, 02:58 PM
  4. Vlookup with ranged name question
    By fa5fou5 in forum Excel General
    Replies: 3
    Last Post: 03-04-2012, 05:22 PM
  5. Automatically grab and chart data from a web address?
    By tino4475 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2011, 05:05 AM
  6. Sum if date ranged.
    By jesseka in forum Excel General
    Replies: 2
    Last Post: 12-13-2010, 04:48 PM
  7. Lookup Two Named Ranged
    By yawnzzzz in forum Excel General
    Replies: 3
    Last Post: 09-24-2010, 03:10 PM
  8. Ranged function results.
    By OverklocK in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-23-2006, 02:45 AM

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