+ Reply to Thread
Results 1 to 7 of 7

2 variables to create result

  1. #1
    Registered User
    Join Date
    03-09-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    59

    2 variables to create result

    Hi Guys,

    I am wanting to create 2 drop downs that when selected show a result dependant on the two chosen.

    eg: pick a from drop down A and B from drop down 2 and it gives you result C.

    I have managed to do it if I do it with
    Please Login or Register  to view this content.
    however I have to write each result for each query.

    So I was wondering if a macro is possible to perhaps make this easier, perhaps using a system similar to PHP where each dropdown is treated as a variable.

    I hope that makes sence!

    Thanks, James
    Last edited by subtilty; 03-10-2010 at 07:52 AM. Reason: Closed as found alternate way

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: 2 variables to create result

    Could you possibly post a data sample?

    So you have dropdown A1 and dropdown B1. You want to show a result based on the selection in A1 and B1.

    You could use something like

    =INDEX(Sheet1!C1:C100,MATCH(A1&B1,INDEX(Sheet2!A1:A100&Sheet2!B1:B100,0),0))

    But to adjust the formula to your needs, I'd have to see your data structure.

    cheers

  3. #3
    Registered User
    Join Date
    03-09-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: 2 variables to create result

    Example attached, thank you!
    Attached Files Attached Files

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: 2 variables to create result

    Pardon?

    Could you explain a bit more? The contents of Sheet1 B2 to C19 is all the same text. So why bother with a lookup or Index/Match???

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: 2 variables to create result

    Pardon?

    Could you explain a bit more? The contents of Sheet1 B2 to C19 is all the same text. So why bother with a lookup or Index/Match???

  6. #6
    Registered User
    Join Date
    03-09-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: 2 variables to create result

    The text is very much just filling it for example, apologies. The text is subject to change.

  7. #7
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: 2 variables to create result

    If the text is all the same in your data sample, how can we test if a formula produces the correct result???

+ 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