+ Reply to Thread
Results 1 to 10 of 10

Cell = oranges when B1=x and B2=y

  1. #1
    Registered User
    Join Date
    07-05-2018
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    26

    Cell = oranges when B1=x and B2=y

    I don't know enough to ask this question concisely, which makes using google to find the answer difficult.

    I have two pull down menus. Based on the contents of those two cells, I want something else displayed in a third cell

    Please Login or Register  to view this content.
    If A1 is Blue, and B1 is Oranges, C1 displays -120.

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

    Re: Cell = oranges when B1=x and B2=y

    Try this:

    =LOOKUP(B1,{"Apples","Grapes","Oranges"},IF(A1="Green",{-100,-110,-105},{-115,-125,-120}))

  3. #3
    Registered User
    Join Date
    07-05-2018
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    26

    Re: Cell = oranges when B1=x and B2=y

    Unfortunately that answers exactly what I asked. But I missed a column because I actually need three pulldown menus...
    How do I apply LOOKUP to this? (Or do I need something else?)

    Please Login or Register  to view this content.

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

    Re: Cell = oranges when B1=x and B2=y

    I don't understand the layout of post #3.

    I recommend creating a table with 4 columns (Color, Item, Fruit, and Number) that shows all of the possible inputs and outcomes.

    Once we have this, we can create a formula to look for a match in that table and return the number of that match.

  5. #5
    Registered User
    Join Date
    07-05-2018
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    26

    Re: Cell = oranges when B1=x and B2=y

    My bad, that was poorly done

    Please Login or Register  to view this content.
    If A is Green and B is Crate and C is Grapes, D displays and answer of -305

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

    Re: Cell = oranges when B1=x and B2=y

    Okay, you have a few options here.

    Since there are now 12 different values, we can still hard code it like in post #2 but at this point I would suggest using this table that you have created (let's say in F2:I13) and using a simple formula like this:

    =SUMIFS(I:I,F:F,A1,G:G,B1,H:H,C1)

    For example, with "Blue" in A1, "Box" in B1, and "Grapes" in C1, the formula would return -310.

  7. #7
    Registered User
    Join Date
    07-05-2018
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    26

    Re: Cell = oranges when B1=x and B2=y

    What I'm going to have is three pulldown menus located at E1 F1 and G1

    If through pulldown menus a Green Box of Grapes is chosen, D1 will show -300

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

    Re: Cell = oranges when B1=x and B2=y

    That's exactly what the solution from post #6 provides.

    I tested it with A1=Green, B1=Box, and C1=Grapes and the formula in D1 resulted in -300.

    This will give you the same result but it is hard coded and will be harder to understand and edit/modify:

    =LOOKUP(C1,{"Apples","Grapes","Oranges"},IF(A1="Blue",IF(B1="Box",{-210,-310,-110},{-215,-305,-115}),IF(B1="Box",{-200,-300,-100},{-205,-305,-105})))

  9. #9
    Registered User
    Join Date
    07-05-2018
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    26

    Re: Cell = oranges when B1=x and B2=y

    Ah, now that I've played with it I understand.
    My response was based on just reading the answer rather than playing with it. I'd have tried it out, but had to step out for a bit and wanted to ensure my question was understood.

    Thanks for all the help!

    (I'm pretty sure there's something to mark a thread a solved, but I'm having a hard time finding it)

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

    Re: Cell = oranges when B1=x and B2=y

    You're welcome. Happy to help.

+ 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. [SOLVED] cell a function doing math on previous sheet, cell b - cell c result in cell d...
    By dad812 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-08-2018, 08:20 AM
  2. [SOLVED] Range search two conditions - Bananas and Oranges!
    By VBAtor in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2015, 06:21 PM
  3. Apples and Oranges Counting Mystery using Excel ?
    By mbwatersuk in forum Excel General
    Replies: 4
    Last Post: 02-03-2015, 02:56 PM
  4. [SOLVED] How to create/run "cell A equals Cell B put Cell C info in Cell D
    By abmb161 in forum Excel General
    Replies: 7
    Last Post: 02-05-2014, 02:20 AM
  5. Replies: 1
    Last Post: 11-03-2012, 09:05 PM
  6. Apples and Oranges = Time and Production
    By ComcoDG in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-06-2008, 06:00 PM
  7. Apples, Bananas, Oranges -- Can Excel Spit Out the Highest?
    By AnnieHall25 in forum Excel General
    Replies: 2
    Last Post: 05-02-2007, 08:24 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