+ Reply to Thread
Results 1 to 5 of 5

Populate cell with the relevant Name Range a value belongs to

  1. #1
    Registered User
    Join Date
    11-15-2016
    Location
    Aberdeen, Scotland
    MS-Off Ver
    2010
    Posts
    12

    Populate cell with the relevant Name Range a value belongs to

    Hi.

    I have received a batch of contract data which includes the country in which a contract was executed among other details - the dataset does not capture what continent/region the country belonged to. I am required to compare the dataset I have received with full year actual financials which splits the data by continent/region.

    In the original dataset I need to list next to each country what region it belongs to based on specified Named Ranges (see below) e.g. Cell A1 equals "UK" I then want a formula for cell A2 that would generate "Europe" and so on.

    1) Europe
    2) North_America
    3) Central_America
    4) South_America
    5) Middle_East_Africa
    6) Asia_Pacific
    7) ROW

  2. #2
    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,319

    Re: Populate cell with the relevant Name Range a value belongs to

    So table with Country/Region Relationship:

    =VLOOKUP(A2,X2:Y1000,2)

    where X:Y range contains Country (In X) /Region (in Y)

    ????

  3. #3
    Registered User
    Join Date
    11-15-2016
    Location
    Aberdeen, Scotland
    MS-Off Ver
    2010
    Posts
    12

    Re: Populate cell with the relevant Name Range a value belongs to

    Please see attachment for guidance.
    Attached Files Attached Files

  4. #4
    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,319

    Re: Populate cell with the relevant Name Range a value belongs to

    Changed table layout (sorry!)

    in D3 and copy down

    =IFERROR(VLOOKUP(C3,Regions!$B$3:$C$93,2,0),"")
    Attached Files Attached Files

  5. #5
    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,319

    Re: Populate cell with the relevant Name Range a value belongs to

    If you want to keep the original table then

    in D3

    =IF(SUMPRODUCT((Regions!$D$3:$J$34=$C3)*COLUMN(Regions!$D$3:$J$34))=0,"",INDEX(Regions!$A$2:$J$2,SUMPRODUCT((Regions!$D$3:$J$34=$C3)*COLUMN(Regions!$D$3:$J$34))))

    Example is in G3 of the attached.
    Attached Files Attached Files

+ 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] Initiate macro when target belongs to certain range
    By Excelbuddy_7 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-10-2015, 05:36 AM
  2. Replies: 1
    Last Post: 05-30-2015, 12:15 PM
  3. [SOLVED] VBA selecting relevant data from master sheet to populate new workbooks
    By monkeypants in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-20-2015, 12:21 PM
  4. Scalable formula to determine which cell range a value belongs to
    By zbomb2000 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-27-2013, 03:49 PM
  5. [SOLVED] Generate new worksheets from cell names and populate them with relevant info.
    By skyping in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-28-2013, 08:26 PM
  6. Replies: 8
    Last Post: 04-05-2013, 02:11 PM
  7. [SOLVED] VBA to copy relevant data and populate a template sheet
    By kenadams378 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 01-31-2013, 02:08 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