close

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 = quot;Dogquot; then the value of B1 should equal the value in cell E21
- If cell A1 = quot;Catquot; then the value of B1 should equal the value in cell F21
- If cell A1 = quot;Mousequot; 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

Try this in B1:

=IF(A1=quot;Dogquot;,E21,IF(A1=quot;Catquot;,F21,IF(A1=quot;Mousequot;,G21 ,quot;Not specifiedquot;)))

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

Hope this helps.

Pete
Try this formula in B1

=INDEX(E21:G21,MATCH(A1,{quot;Dogquot;,quot;Catquot;,quot;Mousequot;},0))--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: www.excelforum.com/member.php...oamp;userid=30486
View this thread: www.excelforum.com/showthread...hreadid=511528hi pete,

i tried this, but get an error. excel highlights this part of the formula:
quot;quot;Dogquot;,E21,IFquot;

any thoughts?
doon

hi there,

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

any thoughts?
d


Hi, doon

both my suggestion and Pete's work for me

are you using those exact formulas?--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: www.excelforum.com/member.php...oamp;userid=30486
View this thread: www.excelforum.com/showthread...hreadid=511528got 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;quot;Not specifiedquot;)))

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
quot;fixquot; there as well...

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 Vaughnquot;doonquot; wrote:

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

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()