+ Reply to Thread
Results 1 to 9 of 9

How to change the source of a cell by changing the value of another cell

  1. #1
    Registered User
    Join Date
    01-11-2013
    Location
    dammam
    MS-Off Ver
    Excel 2013
    Posts
    31

    Question How to change the source of a cell by changing the value of another cell

    Dears All,

    I tried to Google and search for and answer with no luck. Please help!

    Please see an example of the problem I'm having in this excel file with the explanation inside

    http://uploading.com/e4f2c299/exampl...-question-xlsx

    I basically want the source of the data in a cell to be changed once another cell value is changed. I tried multiple formulas with no luck as well.

    Regards,

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,047

    Re: How to change the source of a cell by changing the value of another cell

    Hi bssol and welcome to the forum

    THis is probably way too simple for what you want, but have you tried this? Assuming the number that you want to automatically change is in A1, and the number you want to use to make that number change is in B1...
    in A1 put =B1

    you can upload your file here...
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    01-11-2013
    Location
    dammam
    MS-Off Ver
    Excel 2013
    Posts
    31

    Re: How to change the source of a cell by changing the value of another cell

    Yes you are correct, what you recommended is not what I'm looking for.

    I think the attached spredsheet will explain my request better.

    Thank you for your advise.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,355

    Re: How to change the source of a cell by changing the value of another cell

    It looks to me like you want the HLOOKUP() function http://office.microsoft.com/en-us/ex...in=HA102752948
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Registered User
    Join Date
    01-11-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: How to change the source of a cell by changing the value of another cell

    This may help, if it is only few variables as given in the sheet.

    =IF($B$4=1,E10,IF($B$4=2,F10,IF($B$4=3,G10,IF($B$4=4,H10,I10)))) and then drag (copy) the cells in the column.

    The function "INDIRECT" combined with IF function can also help.

  6. #6
    Registered User
    Join Date
    01-11-2013
    Location
    dammam
    MS-Off Ver
    Excel 2013
    Posts
    31

    Re: How to change the source of a cell by changing the value of another cell

    Quote Originally Posted by Yaman74 View Post
    This may help, if it is only few variables as given in the sheet.

    =IF($B$4=1,E10,IF($B$4=2,F10,IF($B$4=3,G10,IF($B$4=4,H10,I10)))) and then drag (copy) the cells in the column.

    The function "INDIRECT" combined with IF function can also help.
    Yes I thought about it already but because I'll have all 12 months it won't work. I have heard that with VB codes you can make 12 nested if function. but I don't use VB codes.

    I'm sure there could be a trick to get the same results with all the lookup functions out there. I'll try HLOOKUP()

    Any more help?

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,047

    Re: How to change the source of a cell by changing the value of another cell

    in B10, copied down, try this...

    =INDEX($E$8:$I$13,ROW(A1)+2,MATCH($B$4,$E$8:$I$8,0))

    Note, if you add/subtract any rows between 8 and 10, adjust the row(A1)+2 accordingly

  8. #8
    Registered User
    Join Date
    01-11-2013
    Location
    dammam
    MS-Off Ver
    Excel 2013
    Posts
    31

    Re: How to change the source of a cell by changing the value of another cell

    Quote Originally Posted by FDibbins View Post
    in B10, copied down, try this...

    =INDEX($E$8:$I$13,ROW(A1)+2,MATCH($B$4,$E$8:$I$8,0))

    Note, if you add/subtract any rows between 8 and 10, adjust the row(A1)+2 accordingly
    Thank you dear, I was trying to asleep when it just hit me! I just needed to use the MAX function because the numbers are increasing each month and I what i wanted is to bring the last month value into the cell. WOW. I'm so in shock right now!

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,047

    Re: How to change the source of a cell by changing the value of another cell

    Im happy you managed to solve your question (although you didnt mention max before lol). Did you try my suggestion though? using max will restrict you to the latest month, with my suggestion, you have the option to pull out any month you want

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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