+ Reply to Thread
Results 1 to 11 of 11

Auto fill cells getting value from different worksheet but only if conditions met

  1. #1
    Registered User
    Join Date
    03-13-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    29

    Auto fill cells getting value from different worksheet but only if conditions met

    I have a spreadsheet formatted like the below...

    id name options increment value
    50 name A options 12 1
    50 name A options 64 2
    50 name A options 12 3
    51 name B options 12 1
    51 name B options 64 2
    51 name B options 12 3
    51 name B options 64 4
    52 name C options 64 1
    52 name C options 12 2

    I wish to fill values into the value column. The values to fill are in another worksheet but I need to fill based on multiple conditions.

    The worksheet containing the required values is just simply like this in column A:-

    Option1
    Option2
    Option3
    Option4
    Option5
    Option6
    Option7
    Option8

    The value column will check the value in the increment column and fill the cell based on it's corresponding value in the other worksheet. This bit can be simply fetched with the following formula in the value column...

    Please Login or Register  to view this content.
    And then copy and drag this down the column.

    But I only want the value column to get filled based on conditions met from the options column. For example:-

    id name options increment value
    50 name A options 12 1 option 1
    50 name A options 64 2
    50 name A options 12 3 option 1
    51 name B options 12 1 option 1
    51 name B options 64 2
    51 name B options 12 3 option 1
    51 name B options 64 4 option 1
    52 name C options 64 1
    52 name C options 12 2 option 1

    Notice how it only fills value from other worksheet if the options contains 'options 12' and not other values such as 'options 64'.

    So I presume the formula
    Please Login or Register  to view this content.
    requires some extending to say skip if options column equals valueX, valueY or valueZ.

    Please let me know if you would like me to supply any further information. Thanks in advance.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Auto fill cells getting value from different worksheet but only if conditions met

    It will be easy to answer and understand your requirement if your attach a sample workbook with expected output


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    03-13-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Auto fill cells getting value from different worksheet but only if conditions met

    Okay, please find attached file.

    In the 'Options' worksheet, you'll see empty column (I).

    Based on the value in column H, I wish to get the corresponding option from the 'Sheet2' worksheet.

    For example:-

    If column H is 1, get value from Sheet2!A1.
    If column H is 6, get value from Sheet2!A6.

    (Top row in Sheet2 needs removing).

    But only fill column I if column F doesn't contain "Square" or "Panorama".

    Hope that helps. Thanks.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Auto fill cells getting value from different worksheet but only if conditions met

    In I2 Cell
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Drag it down...

  5. #5
    Registered User
    Join Date
    03-13-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Auto fill cells getting value from different worksheet but only if conditions met

    Oh wow, that is brilliant. Thank you so much...

    More to come on this one (this spreadsheet is becoming a nightmare but am getting there now).

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Auto fill cells getting value from different worksheet but only if conditions met

    Glad it helps you and thanks for the feedback

    One suggestion: Keep the file in xlsb type if possible, suggesting based on your huge data size.

  7. #7
    Registered User
    Join Date
    03-13-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Auto fill cells getting value from different worksheet but only if conditions met

    Ah great, thanks for the suggestion.

    I only saved as .xlsm because I couldn't figure out how to save as .xls with macros within the workbook. If I save as .xlsb in future, will any macros still run within it?

    Thanks.

  8. #8
    Registered User
    Join Date
    03-13-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Auto fill cells getting value from different worksheet but only if conditions met

    One other query based on this formula...

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    When copying this down multiple rows, how would I modify it so that if condition is met, leave the cell value intact (rather than making it blank). Is that possible?

  9. #9
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Auto fill cells getting value from different worksheet but only if conditions met

    Quote Originally Posted by zigojacko View Post
    I save as .xlsb in future, will any macros still run within it?
    Yes .xlsb supports macros

  10. #10
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Auto fill cells getting value from different worksheet but only if conditions met

    Quote Originally Posted by zigojacko View Post
    One other query based on this formula...
    Try this...
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    03-13-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Auto fill cells getting value from different worksheet but only if conditions met

    Perfect, thanks very much.

+ 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