+ Reply to Thread
Results 1 to 7 of 7

Return value from other file, depending on value in field 'x'

  1. #1
    Registered User
    Join Date
    01-22-2019
    Location
    Copenhagen, Denmark
    MS-Off Ver
    2013
    Posts
    11

    Return value from other file, depending on value in field 'x'

    Okay, so I'm having trouble explaining this, let alone doing it.

    I want a cell returning a different value from another excel file, depending on what is typed in cell 'x'.
    So, if I type "3" in cell B2 a certain value should be entered in cell B10, from another excel file.
    If I type "10" in cell B2, another calue should be entered in B10, from the same file as above.

    Is that possible, and if so, how?

    Hope you can help me out!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Return value from other file, depending on value in field 'x'

    Yes, it's possible.

    How depends on what these numbers refer to and how they relate to the other file.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    01-22-2019
    Location
    Copenhagen, Denmark
    MS-Off Ver
    2013
    Posts
    11

    Re: Return value from other file, depending on value in field 'x'

    Okay, so I want 'Sr.' to take data from 'Sr1'

    If B2 in 'Sr.' is 11, the data in B10 should return data fom cell A11 in 'Sr1'.
    If B2 is 12, data in B10 should return data from cell A12 from 'Sr1', and so forth..
    Attached Files Attached Files

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Return value from other file, depending on value in field 'x'

    With both workbooks open in memory you could use the INDIRECT function.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Registered User
    Join Date
    01-22-2019
    Location
    Copenhagen, Denmark
    MS-Off Ver
    2013
    Posts
    11

    Re: Return value from other file, depending on value in field 'x'

    Richard, that wouldn't always be possible, since I want it to link to several files.
    I work on a virtual desktop with a drive accessable by my entire organisation, so this would be some kind of masterfile collecting the numbers from several workbooks, depending on what I write in the "mastercell"
    So when you open this file and you enter the week number in cell B2, you should get numbers from an array of workbooks.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Return value from other file, depending on value in field 'x'

    Why do you think it's not possible?

    Your original post mentioned looking at a cell in another workbook and hence a formula could contain the name of the other workbook and the master cell would provide the row number to be used in Indirect part of the formula.

    You now appear to be saying that there are many workbooks. In that case yo'll need two master cells. One that contains the name of a workbook and one that contains the row number.

    However it's not clear from your explanation whether there is a one to one relationship beween the summary workbok and another workbook or whether you need to sum the numbers from several workbooks in a one to many relationship.

  7. #7
    Registered User
    Join Date
    01-22-2019
    Location
    Copenhagen, Denmark
    MS-Off Ver
    2013
    Posts
    11

    Re: Return value from other file, depending on value in field 'x'

    I have quite possibly misunderstood you then.
    And have not made my intentions with my workbook entirely clear either.. my lack of working with excel makes it difficult to explain with the correct terms.

    I'll try to write it again, with a little more detail.
    So, I want one "mastercell" where you can write a weeknumber. When writing the weeknumber, all cells containing the formula I'm looking for will return with a value from another workbook. So writing '11' will give me all data from week 11 in the other workbooks.
    This will most likely require a lot of manual work, but that's fine.

    Does that clear things up a little more?

+ 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. Replies: 2
    Last Post: 08-26-2017, 02:44 AM
  2. Add Columns depending on number in field
    By jacob1101 in forum Excel General
    Replies: 0
    Last Post: 10-21-2014, 07:32 PM
  3. [SOLVED] Wishing different results depending if field is blank or 0.00...
    By Clutch Cargo in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-23-2014, 09:31 PM
  4. [SOLVED] Insert 0 at beginning of field depending on no of characters
    By enna1949 in forum Excel General
    Replies: 5
    Last Post: 12-27-2012, 03:51 AM
  5. [SOLVED] Create code for a new field to return different values depending on existing data.
    By DrNerj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2012, 11:04 AM
  6. Printing certain worksheets to PDF depending on value in a field
    By RebeccaEllis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-18-2012, 05:00 PM
  7. How to format field depending on another field?
    By jgomez in forum Access Tables & Databases
    Replies: 7
    Last Post: 03-29-2012, 11:42 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