+ Reply to Thread
Results 1 to 4 of 4

Putting a value into a cell based on values in other cells

  1. #1
    Forum Contributor
    Join Date
    05-20-2017
    Location
    Boston, US
    MS-Off Ver
    Mac 2011
    Posts
    139

    Putting a value into a cell based on values in other cells

    Hello!

    I will try to explain in words what I am trying to achieve, but I am not sure I will be able to explain that, so I am attaching a file as well (it has macros, but you can disable them - they are not relevant for this task).

    There are two sheets in a workbook.

    In sheet_1 in C6 I have a value, which I choose from the drop down list, set up from values in C column in sheet_2.

    I would like to write a function for each cell in column D in sheet_1, which would:

    look at the chosen value, for example, in C6 (or any other cell in column C) in sheet_1,
    and, as this value is from C19 in sheet_2, look at the value in the same row (row 19) but in column D (namely cell D19),
    and if the value in D19 = "done", then the value in D6 in sheet_1 should become "closed".

    I tried to write a function, but I don't see how to move forward and improve it in such a way that it finds the correct row in column D in sheet_2, which corresponds to the value in a specific cell in column C in sheet_2, and thus in column C in sheet_1.

    Please, see a file for clarification.

    Thank you very much!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Putting a value into a cell based on values in other cells

    You could look at using the indirect function.

    Offset or index might work for you too.

    Try this formula in D6

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by mehmetcik; 08-04-2017 at 03:50 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

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

    Re: Putting a value into a cell based on values in other cells

    Try this

    =IFERROR(IF(VLOOKUP(C6,sheet_2!$C$16:$D$29,2,FALSE)="done", "Closed",""),"")
    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

  4. #4
    Forum Contributor
    Join Date
    05-20-2017
    Location
    Boston, US
    MS-Off Ver
    Mac 2011
    Posts
    139

    Re: Putting a value into a cell based on values in other cells

    Quote Originally Posted by ChemistB View Post
    Try this

    =IFERROR(IF(VLOOKUP(C6,sheet_2!$C$16:$D$29,2,FALSE)="done", "Closed",""),"")
    Thank you so much! It did the trick. I will now add OFFSET to make sure that if rows are added, the value returned in still a correct one (so to avoid hardcoding 2).

+ 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: 19
    Last Post: 04-12-2017, 09:42 AM
  2. [SOLVED] Need help in putting automatic data when two values in two cells are the same
    By maneklalm27 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-09-2015, 05:36 AM
  3. [SOLVED] Need help in putting automatic data when two values in two cells are the same
    By maneklalm27 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-09-2015, 04:41 AM
  4. putting values next to a merged cell
    By zazzz in forum Excel General
    Replies: 1
    Last Post: 10-15-2012, 02:06 PM
  5. select certain cells based upon condition and putting in sheet 2
    By jazbath in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-26-2009, 03:03 AM
  6. [SOLVED] Putting decimal values in a cell.
    By Craig in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-07-2006, 01:35 AM
  7. putting values into cells is slow
    By inquirer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-12-2005, 11:06 PM

Tags for this Thread

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