+ Reply to Thread
Results 1 to 11 of 11

IF formula with limiting choices

  1. #1
    Registered User
    Join Date
    11-22-2020
    Location
    Nebraska
    MS-Off Ver
    Office 365
    Posts
    6

    IF formula with limiting choices

    In my worksheet I have a dropdown list in cell A1 that has 6 model homes names. In A2 I have 20 selections for lots to build on. Each model of home can only fit on certain lots. How to I limit my choice of lots if I choose a particular model of home. example: Urban Modern home can only be built on lots 1, 3, 12. When I choose Urban Modern from the drop down list I only want Lots 1, 3, 12 to be available to choose from.
    Thank you in advance for your help.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: IF formula with limiting choices

    You need a named range for each of the model homes, which lists the plots available. If you use the names of the model homes as the named range (with underscore instead of spaces), then your second DV drop-down would have this formula as its source:

    =INDIRECT(SUBSTITUTE(A1," ","_"))

    Attach a sample Excel workbook by following the instructions in the yellow banner at the top of the screen, and I can set this up for you.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    11-22-2020
    Location
    Nebraska
    MS-Off Ver
    Office 365
    Posts
    6

    Re: IF formula with limiting choices

    Thank you Pete! On the attached worksheet the data is on the second worksheet "models". In column B there are the model choices and at the bottom are the lot choices.
    So on the pricing spreadsheet in cell C9 is the dropdown box for models. If Country Meadow is selected I would like the the choices in C10 to be limited to
    Lots; B1L65 (model worksheet B30), B1L66 (model worksheet B31), B1L69 (Model Worksheet B27), B1L70 (Model worksheet B28). If the model choice is Urban Modern then
    the only lot choices should be B3L8, B3L9, B4L14, B4L15 (model worksheet cells B18, B23, B19, B20, respectively). I'm hoping if you start this that I will
    be able to run with it.
    Thank you again.
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: IF formula with limiting choices

    I've set this up for you in the attached file, using the data you have given me.

    I've listed your models in column J and given those the named range "Models". To set up a named range you just merely have to select the heading and the values below it then click on Formulas | Create from Selection (in the Named Ranges section) and click on Top Row then OK. I've also listed the plots to the right of the models and given them a named range in the same way, although clicking Left column rather than Top Row.

    The named ranges are needed for the data validation drop-downs on the other sheet, although you should be aware that spaces are not allowed in a name, and so Excel automatically changes them to an underscore. You can see this by clicking Name Manager.

    In the first sheet I've set up a data validation drop-down in cell C9, using the named range Models. I've also set up a dependent data validation drop-down in C10, although this uses a formula similar to the one I have given you to define the list, i.e.:

    =INDIRECT(SUBSTITUTE($C$9," ","_"))

    You can see that this takes the model in C9 and changes the spaces to underscores, thus giving the appropriate lot choices for that model.

    So, all you have to do is add the lot numbers to the appropriate models in the Models sheet and set up named ranges for each of them, and then you're done.

    Hope this helps.

    Pete
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-22-2020
    Location
    Nebraska
    MS-Off Ver
    Office 365
    Posts
    6

    Re: IF formula with limiting choices

    Thank you Pete!! You are a tremendous help. Your instructions are very helpful even though it will take me awhile to dissect the formulas.
    This is exactly what I needed.

  6. #6
    Registered User
    Join Date
    11-22-2020
    Location
    Nebraska
    MS-Off Ver
    Office 365
    Posts
    6

    Re: IF formula with limiting choices

    Pete. I attempted to duplicate what you did, but I have obviously missed a step. The models that I created don't allow for a dropdown box for C10 the way yours do. Please show me what I did wrong.

  7. #7
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: IF formula with limiting choices

    DV can be generated without name
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    11-22-2020
    Location
    Nebraska
    MS-Off Ver
    Office 365
    Posts
    6

    Re: IF formula with limiting choices

    Pete, I've attached the worksheet again with my attempt to add to the "models" and "lots" that you started. I'm a novice and have no idea what to do
    to get the dropdown to work properly for the models I added ie. Garden Beauty.
    Attached Files Attached Files

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: IF formula with limiting choices

    It was because you had hyphens in those model types, and they also get turned into underscores (which my formula did not account for). I've removed the hyphens and extra spaces for you in the attached file, and reset the names for those ranges, and all seems to work as it should now.

    Hope this helps.

    Pete
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    11-22-2020
    Location
    Nebraska
    MS-Off Ver
    Office 365
    Posts
    6

    Re: IF formula with limiting choices

    Thanks Again Pete! This is fantastic!
    Was there an easier way for me to set up F10? I used multiple "IF's", but as this housing development grows I can see how this could become difficult to manage.
    I'm happy with it either way. Thank you.

  11. #11
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: IF formula with limiting choices

    Your monster formula in F10 can be simplified to this:

    =IFERROR(VLOOKUP(C10,Models!$B$17:$C$31,2,0),"")

    It does the same job, but is much more compact, and will return a blank if C10 is not found in the range - you could change this to something else if you like (e.g. zero instead of "" at the end).

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Hope this helps.

    Pete

+ 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. Drop Down choices should reflect choices
    By ed1984 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-06-2020, 12:23 PM
  2. [SOLVED] Multiple Choices in an IF/THEN Formula
    By islandeeya in forum Excel General
    Replies: 14
    Last Post: 05-17-2018, 06:49 PM
  3. removing "Select All" and limiting filter choices in a Pivot table
    By jettabar99 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 09-25-2013, 09:07 AM
  4. [SOLVED] Limiting a formula summary not to exceed a value
    By plymouthcolt in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-03-2013, 02:23 AM
  5. Drop-down list choices restricting choices of other lists?
    By not_quite_excelling in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-25-2011, 06:04 AM
  6. limiting characters in a cell by formula
    By Campbell in forum Excel General
    Replies: 2
    Last Post: 07-26-2006, 12:50 PM
  7. [SOLVED] Hidding the formula and limiting users
    By bimseun in forum Excel General
    Replies: 1
    Last Post: 04-04-2006, 05:45 AM

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