+ Reply to Thread
Results 1 to 10 of 10

Help with a formula which will provide a value after two text cells are selected

  1. #1
    Registered User
    Join Date
    11-30-2018
    Location
    Berkshire, England
    MS-Off Ver
    2013
    Posts
    5

    Help with a formula which will provide a value after two text cells are selected

    Hi, I'm looking for a formula, hopefully someone will help.
    Basically I want to be able to select from two drop down lists a word, then once both of these words are selected, it provides me with a number.

    So for example,

    One drop down list will be country - So I would select UK, then on the second drop down list will be a type of fruit - so strawberries and then in the next cell it will generate a number and be 5.
    I would like this to change dependent on the country and fruit. So if I still selected UK, but chose raspberries, it will say 10.

    Could anyone help me with this?

    Thanks
    Attached Files Attached Files
    Last edited by J.osephw; 11-30-2018 at 01:09 PM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Help with a formula

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?).

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

  3. #3
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Help with a formula

    So there must be a reference table that lists countries and fruits.
    Attach a sample file to show your layout.
    Formula will depend on how it's setup.
    1. Click on the * Add Reputation if you think this helped you
    2. Mark your thread as SOLVED when question is resolved

    Modytrane

  4. #4
    Registered User
    Join Date
    11-30-2018
    Location
    Berkshire, England
    MS-Off Ver
    2013
    Posts
    5

    Re: Help with a formula

    Hi,
    Thanks for your reply.
    I have attached a sample table so you can see the layout.
    So for example when UK and apples is selected it will display 5, but if it was Spain and apples it would display 10.

    Thanks

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Help with a formula which will provide a value after two text cells are selected

    Hello and welcome to the forum. Try this:

    =INDEX(B4:E8,MATCH(G2,A4:A8,0),MATCH(G1,B3:E3,0))

    Where G1 is the country and G2 is the Fruit.

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Help with a formula

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

    -

    IndexMatch2.jpg
    Last edited by davesexcel; 11-30-2018 at 03:36 PM.

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Help with a formula which will provide a value after two text cells are selected

    Dave, I think you have the row # and column # reversed.

  8. #8
    Registered User
    Join Date
    11-30-2018
    Location
    Berkshire, England
    MS-Off Ver
    2013
    Posts
    5

    Re: Help with a formula which will provide a value after two text cells are selected

    Hi, thanks for your help,

    I have recreated the formula and its perfect, however when I try and select UK and Chilli or and country and chilli, it comes up with #REF!, do you know why this could be?

    Thanks

  9. #9
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Help with a formula which will provide a value after two text cells are selected

    What I gave you in post #5 works fine based on what you have shared.

    If you used Dave's formula, he had the row and column numbers mixed up (as mentioned in post #7) which would explain why you are getting a REF error. Chilli is the 5th row and there are only 4 columns.

    If you upload the workbook showing the error, we can remedy that for you.

  10. #10
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Help with a formula which will provide a value after two text cells are selected

    Woops, post has been edited.

+ 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: 5
    Last Post: 02-16-2018, 06:50 AM
  2. Replies: 8
    Last Post: 09-22-2017, 05:41 AM
  3. Excel formula bar to display the result of the formula , not the formula?
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2016, 07:15 PM
  4. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  5. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 PM

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