ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Logical AND function (https://www.excelbanter.com/excel-worksheet-functions/24679-logical-function.html)

John Pinback

Logical AND function
 
If I name an array G2:G90 Used and a second array H2:H90 Allowed and put
logical values in these columns then I should be able to use the AND
function but it gives me the wrong answer.

For example, say G3 = TRUE and H3 = TRUE and I put the following formula in
I3:

= AND(Used, Allowed)

I expect to see TRUE in I3 but I get FALSE.

Thanks,
Karl
kwb AT dcm-va.com



Bob Phillips

Karl,

Got a False somewhere else in Used or Allowed?

--
HTH

Bob Phillips

"John Pinback" wrote in message
news:GZPde.2321$cf5.869@lakeread07...
If I name an array G2:G90 Used and a second array H2:H90 Allowed and put
logical values in these columns then I should be able to use the AND
function but it gives me the wrong answer.

For example, say G3 = TRUE and H3 = TRUE and I put the following formula

in
I3:

= AND(Used, Allowed)

I expect to see TRUE in I3 but I get FALSE.

Thanks,
Karl
kwb AT dcm-va.com





Peo Sjoblom

So you want to return TRUE if adjacent cells are TRUE regardless of how many?

=SUMPRODUCT(--(Used=TRUE),--(Allowed=TRUE))0

will do it

Otherwise if you are copying down in I checking each row and don't want to use
the cell references

=IF(ISERR(AND(INDEX(Used,ROW()),INDEX(Allowed,ROW( )))),"",AND(INDEX(Used,ROW()),INDEX(Allowed,ROW()) ))

will retrun TRUE for 2 adjacent cells holding TRUE

Regards,

Peo Sjoblom

"John Pinback" wrote:

If I name an array G2:G90 Used and a second array H2:H90 Allowed and put
logical values in these columns then I should be able to use the AND
function but it gives me the wrong answer.

For example, say G3 = TRUE and H3 = TRUE and I put the following formula in
I3:

= AND(Used, Allowed)

I expect to see TRUE in I3 but I get FALSE.

Thanks,
Karl
kwb AT dcm-va.com




John Pinback

Bob,

I was able to get it to work by doing this:

AND(Used=TRUE, Allowed=TRUE)

Looks ugly but it works.

Thanks,
Karl
"Bob Phillips" wrote in message
...
Karl,

Got a False somewhere else in Used or Allowed?

--
HTH

Bob Phillips

"John Pinback" wrote in message
news:GZPde.2321$cf5.869@lakeread07...
If I name an array G2:G90 Used and a second array H2:H90 Allowed and put
logical values in these columns then I should be able to use the AND
function but it gives me the wrong answer.

For example, say G3 = TRUE and H3 = TRUE and I put the following formula

in
I3:

= AND(Used, Allowed)

I expect to see TRUE in I3 but I get FALSE.

Thanks,
Karl
kwb AT dcm-va.com







bj

I am not sure what you are trying to do. If you are trying to just check if
G3 and H3 are true I would try
=and(G3,H3)

= AND(Used, Allowed)
will only give true if every cell in Used and Allowed has a true or is blank

"John Pinback" wrote:

If I name an array G2:G90 Used and a second array H2:H90 Allowed and put
logical values in these columns then I should be able to use the AND
function but it gives me the wrong answer.

For example, say G3 = TRUE and H3 = TRUE and I put the following formula in
I3:

= AND(Used, Allowed)

I expect to see TRUE in I3 but I get FALSE.

Thanks,
Karl
kwb AT dcm-va.com




bj

this will only work for the first cell in each ranges. this is the same as
And(G2,H2)

"John Pinback" wrote:

Bob,

I was able to get it to work by doing this:

AND(Used=TRUE, Allowed=TRUE)

Looks ugly but it works.

Thanks,
Karl
"Bob Phillips" wrote in message
...
Karl,

Got a False somewhere else in Used or Allowed?

--
HTH

Bob Phillips

"John Pinback" wrote in message
news:GZPde.2321$cf5.869@lakeread07...
If I name an array G2:G90 Used and a second array H2:H90 Allowed and put
logical values in these columns then I should be able to use the AND
function but it gives me the wrong answer.

For example, say G3 = TRUE and H3 = TRUE and I put the following formula

in
I3:

= AND(Used, Allowed)

I expect to see TRUE in I3 but I get FALSE.

Thanks,
Karl
kwb AT dcm-va.com









All times are GMT +1. The time now is 10:24 PM.

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