Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Calculate true/false value based on array text input

Hi NG,

I'm struggeling a bit with this task. I have two columns with data, like

A TRUE
A FALSE
B FALSE
C TRUE

I need a formula in a 3rd column that calculates a value of TRUE/FALSE
considering the existing values A, B and C. The result should be like this:

A TRUE FALSE
A FALSE FALSE
B FALSE FALSE
C TRUE TRUE

A: Is always FALSE because there is one record with the value FALSE
B: Is FALSE as there is only one value with FALSE
C: Is TRUE

I have look at sumproduct(), sum() and sumif() but I quite can't get the
formula right.

Basically what should happen should be all the A values are considered
for rows of data with A. The TRUE * FALSE = FALSE, TRUE*TRUE = TRUE and
FALSE*FALSE=FALSE.

How the heck should I do this? Any suggestions are warmly welcome
- Chr
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Calculate true/false value based on array text input

Maybe this:

=SUMPRODUCT(--(A$1:A$4=A1),--B$1:B$4)=COUNTIF(A$1:A$4,A1)

Copied down

Biff

"Christian" wrote in message
...
Hi NG,

I'm struggeling a bit with this task. I have two columns with data, like

A TRUE
A FALSE
B FALSE
C TRUE

I need a formula in a 3rd column that calculates a value of TRUE/FALSE
considering the existing values A, B and C. The result should be like
this:

A TRUE FALSE
A FALSE FALSE
B FALSE FALSE
C TRUE TRUE

A: Is always FALSE because there is one record with the value FALSE
B: Is FALSE as there is only one value with FALSE
C: Is TRUE

I have look at sumproduct(), sum() and sumif() but I quite can't get the
formula right.

Basically what should happen should be all the A values are considered for
rows of data with A. The TRUE * FALSE = FALSE, TRUE*TRUE = TRUE and
FALSE*FALSE=FALSE.

How the heck should I do this? Any suggestions are warmly welcome
- Chr



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Calculate true/false value based on array text input

Bingo! That does the trick - thanks!
I would never have thought of putting two "=" in the same formular like
your proposal - I wonder if that's a special array thing.
But it works brilliantly.
Thanks Mr. Valko!
- Chr

T. Valko wrote:
Maybe this:

=SUMPRODUCT(--(A$1:A$4=A1),--B$1:B$4)=COUNTIF(A$1:A$4,A1)

Copied down

Biff

"Christian" wrote in message
...
Hi NG,

I'm struggeling a bit with this task. I have two columns with data, like

A TRUE
A FALSE
B FALSE
C TRUE

I need a formula in a 3rd column that calculates a value of TRUE/FALSE
considering the existing values A, B and C. The result should be like
this:

A TRUE FALSE
A FALSE FALSE
B FALSE FALSE
C TRUE TRUE

A: Is always FALSE because there is one record with the value FALSE
B: Is FALSE as there is only one value with FALSE
C: Is TRUE

I have look at sumproduct(), sum() and sumif() but I quite can't get the
formula right.

Basically what should happen should be all the A values are considered for
rows of data with A. The TRUE * FALSE = FALSE, TRUE*TRUE = TRUE and
FALSE*FALSE=FALSE.

How the heck should I do this? Any suggestions are warmly welcome
- Chr



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Calculate true/false value based on array text input

I wonder if that's a special array thing.

No. It's just comapring two different values for equality.

=SUMPRODUCT(--(A$1:A$4=A1),--B$1:B$4)

--B$1:B$4

Converts the TRUE or FALSE to 1 or 0. Then Sumproduct retruns the sum. If
the sum equals the result of the Countif then that condition is TRUE
otherwise, it's FALSE.

For criteria "A" the sum is 1 and the count is 2:

=1=2 = FALSE

Biff

"Christian" wrote in message
...
Bingo! That does the trick - thanks!
I would never have thought of putting two "=" in the same formular like
your proposal - I wonder if that's a special array thing.
But it works brilliantly.
Thanks Mr. Valko!
- Chr

T. Valko wrote:
Maybe this:

=SUMPRODUCT(--(A$1:A$4=A1),--B$1:B$4)=COUNTIF(A$1:A$4,A1)

Copied down

Biff

"Christian" wrote in message
...
Hi NG,

I'm struggeling a bit with this task. I have two columns with data, like

A TRUE
A FALSE
B FALSE
C TRUE

I need a formula in a 3rd column that calculates a value of TRUE/FALSE
considering the existing values A, B and C. The result should be like
this:

A TRUE FALSE
A FALSE FALSE
B FALSE FALSE
C TRUE TRUE

A: Is always FALSE because there is one record with the value FALSE
B: Is FALSE as there is only one value with FALSE
C: Is TRUE

I have look at sumproduct(), sum() and sumif() but I quite can't get the
formula right.

Basically what should happen should be all the A values are considered
for rows of data with A. The TRUE * FALSE = FALSE, TRUE*TRUE = TRUE and
FALSE*FALSE=FALSE.

How the heck should I do this? Any suggestions are warmly welcome
- Chr



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding rows in a range based on TRUE/FALSE value in each row michaelberrier Excel Discussion (Misc queries) 1 December 28th 06 10:33 PM
Can Excel operate a function based on a true or false result? SteveD Excel Worksheet Functions 1 August 26th 05 01:47 PM
how to change colour of text in true or false formula linda Excel Worksheet Functions 1 August 23rd 05 09:58 AM
Displaying data based on a TRUE/FALSE value in a cell static69 Excel Discussion (Misc queries) 3 June 1st 05 07:09 AM
need array of true/false if text exists alex Excel Worksheet Functions 0 November 16th 04 09:58 AM


All times are GMT +1. The time now is 10:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"