ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Multiple "IF"'s (https://www.excelbanter.com/excel-worksheet-functions/200343-multiple-if-s.html)

Solar Man[_2_]

Multiple "IF"'s
 
I thought I had this one licked. I have a list of TRUE FALSE cells. There
are 18 of them. Say they were listed A1:A9 and B1:B9 then if A! is TRUE,
insert contents of C1. If A6 is TRUE, insert contents of C6 and so on. Only
one of them will be TRUE at any time. I tried using multiple IF's but found
I could only enter 6 and then it wouldn't take any more. Is there a better
way to do this? Thank you in advance.

smartin

Multiple "IF"'s
 
Solar Man wrote:
I thought I had this one licked. I have a list of TRUE FALSE cells. There
are 18 of them. Say they were listed A1:A9 and B1:B9 then if A! is TRUE,
insert contents of C1. If A6 is TRUE, insert contents of C6 and so on. Only
one of them will be TRUE at any time. I tried using multiple IF's but found
I could only enter 6 and then it wouldn't take any more. Is there a better
way to do this? Thank you in advance.


Could you use
=IF(OR(A1,B1),C1,"")
?

Bob Bridges[_2_]

Multiple "IF"'s
 
And if the first TRUE is in B3, would you then want to use the value in D3?

The solution I have in mind won't deal with such a table, a search in more
than one column I mean. But if you can put the whole thing not in A1:D9 but
in A1:<x18, there are a couple of ways you can solve this pretty easily.

Let's say your Boolean values are in A1:A18, and the desired results in
B1:B18. If you were to use =VLOOKUP(TRUE,A1:B18,2,0), what that'll do is
search down the left-hand column of the table you defined (A1:B18) until it
finds the value you said to look for (TRUE); when it finds it, it'll return
the value in the 2nd column. Will that do?

--- "Solar Man" wrote:
I thought I had this one licked. I have a list of TRUE FALSE cells. There
are 18 of them. Say they were listed A1:A9 and B1:B9 then if A! is TRUE,
insert contents of C1. If A6 is TRUE, insert contents of C6 and so on. Only
one of them will be TRUE at any time. I tried using multiple IF's but found
I could only enter 6 and then it wouldn't take any more. Is there a better
way to do this? Thank you in advance.


Max

Multiple "IF"'s
 
Presuming you meant that *both* cols A & B must be TRUE,
eg A3 & B3 must both be TRUE, then return C3
and that there would at any one time,
be only 1 line satisfying this criteria within A1:B9

Then in say, D1, array-entered*:
=INDEX(C1:C9,MATCH(1,(A1:A9)*(B1:B9),0))
will return the result from C1:C9

*press CTRL+SHIFT+ENTER to confirm the formula
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:17,500 Files:358 Subscribers:55
xdemechanik
---
"Solar Man" wrote:
I thought I had this one licked. I have a list of TRUE FALSE cells. There
are 18 of them. Say they were listed A1:A9 and B1:B9 then if A! is TRUE,
insert contents of C1. If A6 is TRUE, insert contents of C6 and so on. Only
one of them will be TRUE at any time. I tried using multiple IF's but found
I could only enter 6 and then it wouldn't take any more. Is there a better
way to do this? Thank you in advance.


Solar Man[_2_]

Multiple "IF"'s
 
Thank you to everyone. It's late and I will try these solutions in the
morning. Thank you all again for your help

"Max" wrote:

Presuming you meant that *both* cols A & B must be TRUE,
eg A3 & B3 must both be TRUE, then return C3
and that there would at any one time,
be only 1 line satisfying this criteria within A1:B9

Then in say, D1, array-entered*:
=INDEX(C1:C9,MATCH(1,(A1:A9)*(B1:B9),0))
will return the result from C1:C9

*press CTRL+SHIFT+ENTER to confirm the formula
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:17,500 Files:358 Subscribers:55
xdemechanik
---
"Solar Man" wrote:
I thought I had this one licked. I have a list of TRUE FALSE cells. There
are 18 of them. Say they were listed A1:A9 and B1:B9 then if A! is TRUE,
insert contents of C1. If A6 is TRUE, insert contents of C6 and so on. Only
one of them will be TRUE at any time. I tried using multiple IF's but found
I could only enter 6 and then it wouldn't take any more. Is there a better
way to do this? Thank you in advance.


Solar Man[_2_]

Multiple "IF"'s
 
Hi Bob,
Thank you for helping me. My TRUE:FALSE column is I39:I57. The requires
answers are in column K30:K57.

I used the formula VLOOKUP(TRUE,I39:I57,2,0) and it returned #REF!. I tried
substituting the "2" for other numbers. Can you still help??

"Bob Bridges" wrote:

And if the first TRUE is in B3, would you then want to use the value in D3?

The solution I have in mind won't deal with such a table, a search in more
than one column I mean. But if you can put the whole thing not in A1:D9 but
in A1:<x18, there are a couple of ways you can solve this pretty easily.

Let's say your Boolean values are in A1:A18, and the desired results in
B1:B18. If you were to use =VLOOKUP(TRUE,A1:B18,2,0), what that'll do is
search down the left-hand column of the table you defined (A1:B18) until it
finds the value you said to look for (TRUE); when it finds it, it'll return
the value in the 2nd column. Will that do?

--- "Solar Man" wrote:
I thought I had this one licked. I have a list of TRUE FALSE cells. There
are 18 of them. Say they were listed A1:A9 and B1:B9 then if A! is TRUE,
insert contents of C1. If A6 is TRUE, insert contents of C6 and so on. Only
one of them will be TRUE at any time. I tried using multiple IF's but found
I could only enter 6 and then it wouldn't take any more. Is there a better
way to do this? Thank you in advance.


Solar Man[_2_]

Multiple "IF"'s
 
Hi again Bob,
I got it!! Woo hoo. Thank you

"Solar Man" wrote:

Hi Bob,
Thank you for helping me. My TRUE:FALSE column is I39:I57. The requires
answers are in column K30:K57.

I used the formula VLOOKUP(TRUE,I39:I57,2,0) and it returned #REF!. I tried
substituting the "2" for other numbers. Can you still help??

"Bob Bridges" wrote:

And if the first TRUE is in B3, would you then want to use the value in D3?

The solution I have in mind won't deal with such a table, a search in more
than one column I mean. But if you can put the whole thing not in A1:D9 but
in A1:<x18, there are a couple of ways you can solve this pretty easily.

Let's say your Boolean values are in A1:A18, and the desired results in
B1:B18. If you were to use =VLOOKUP(TRUE,A1:B18,2,0), what that'll do is
search down the left-hand column of the table you defined (A1:B18) until it
finds the value you said to look for (TRUE); when it finds it, it'll return
the value in the 2nd column. Will that do?

--- "Solar Man" wrote:
I thought I had this one licked. I have a list of TRUE FALSE cells. There
are 18 of them. Say they were listed A1:A9 and B1:B9 then if A! is TRUE,
insert contents of C1. If A6 is TRUE, insert contents of C6 and so on. Only
one of them will be TRUE at any time. I tried using multiple IF's but found
I could only enter 6 and then it wouldn't take any more. Is there a better
way to do this? Thank you in advance.



All times are GMT +1. The time now is 12:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com