+ Reply to Thread
Results 1 to 8 of 8

HELP| populate cell with particular value based on multiple condit

  1. #1
    doon
    Guest

    HELP| populate cell with particular value based on multiple condit

    i am not sure how to phrase this, but this is what i am after...

    I want to populate cell B1 with a particular value based on multiple
    conditions in cell A1. I need cell B1 to do the following:

    - If cell A1 = "Dog" then the value of B1 should equal the value in cell E21
    - If cell A1 = "Cat" then the value of B1 should equal the value in cell F21
    - If cell A1 = "Mouse" then the value of B1 should equal the value in cell G21

    how the heck do i do this? is this even possible?

    many thanks,
    doon

  2. #2
    Pete_UK
    Guest

    Re: HELP| populate cell with particular value based on multiple condit

    Try this in B1:

    =IF(A1="Dog",E21,IF(A1="Cat",F21,IF(A1="Mouse",G21,"Not specified")))

    The phrase "Not specified" is returned if none of the criteria are met.
    There is a limit of 7 to the number of IF statements you can "nest" in
    this way - if you have more criteria then there are other ways of
    achieving what you require.

    Hope this helps.

    Pete


  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Try this formula in B1

    =INDEX(E21:G21,MATCH(A1,{"Dog","Cat","Mouse"},0))

  4. #4
    doon
    Guest

    Re: HELP| populate cell with particular value based on multiple co

    hi pete,

    i tried this, but get an error. excel highlights this part of the formula:
    ""Dog",E21,IF"

    any thoughts?
    doon

  5. #5
    doon
    Guest

    Re: HELP| populate cell with particular value based on multiple co

    hi there,

    tried this suggestion as well. excel seems to have an issue with this part
    of the formula: "G21,MATCH"

    any thoughts?
    d

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Hi, doon

    both my suggestion and Pete's work for me

    are you using those exact formulas?

  7. #7
    doon
    Guest

    Re: HELP| populate cell with particular value based on multiple co

    got it to work!

    i used pete's first. i had to change all of the commas to semicolons and
    then it all worked.

    my looks like this:
    =IF(B5=B31;C32;IF(B5=E31;F32;IF(B5=H31;I32;"Not specified")))

    i am referencing other cells to give me the dog, cat, mouse terms in my
    example. somehow, the semicolons seem strange, but this was the magic fix.

    thanks again to you both!
    doon

    p.s. just about to try the second suggestion and will try applying the same
    "fix" there as well...

  8. #8
    Kevin Vaughn
    Guest

    Re: HELP| populate cell with particular value based on multiple co

    It's just that your regional settings are different than those of the people
    who supplied you answers. I use commas, as I believe do most people who are
    in the United States, but for some reason, apparently, different countries or
    regions use the semicolon for delimiter. I don't remember ever reading that
    some regions use other than those two.
    --
    Kevin Vaughn


    "doon" wrote:

    > got it to work!
    >
    > i used pete's first. i had to change all of the commas to semicolons and
    > then it all worked.
    >
    > my looks like this:
    > =IF(B5=B31;C32;IF(B5=E31;F32;IF(B5=H31;I32;"Not specified")))
    >
    > i am referencing other cells to give me the dog, cat, mouse terms in my
    > example. somehow, the semicolons seem strange, but this was the magic fix.
    >
    > thanks again to you both!
    > doon
    >
    > p.s. just about to try the second suggestion and will try applying the same
    > "fix" there as well...


+ 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