Microsoft Office Forums


Reply
Thread Tools Display Modes

find all key-value pairs if there is key with different value

 
 
kang
Guest
Posts: n/a

 
      08-27-2007, 04:17 AM
I want to find all key-value pairs if there is key with different value.
in the case above
A 1
A 1
B 2
B 2
B 3
C 2
C 4
the first
A 1 : should not be formatted because all the values with A key are 1.
A 1 : should not be formatted with the same reason above
B 2 : should be formatted because the values for the Key B is not
uniformly equal
B 2 : should be formatted because the values for the Key B is not
uniformly equal even though there exists the same value with the same key
B 3 : should be formatted because the values for the Key B is not
uniformly equal
C 2 : should be formatted because the values for the Key C is not
uniformly equal
C 4 : should be formatted because the values for the Key C is not
uniformly equal

the format formular is
=SUMPRODUCT(($A$1:$A$10=$A1)*($B$1:$B$10=$B1)*($A$ 1:$A$10<>"")*($B$1:$B$10<>""))=1
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a

 
      08-27-2007, 12:01 PM
I think this does what you want.

Select the range you want to give that format|Conditional format. With A1 the
activecell, use this formula:

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

Adjust the ranges to match--but you can't use whole columns (except in xl2007).

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail here:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

kang wrote:
>
> I want to find all key-value pairs if there is key with different value.
> in the case above
> A 1
> A 1
> B 2
> B 2
> B 3
> C 2
> C 4
> the first
> A 1 : should not be formatted because all the values with A key are 1.
> A 1 : should not be formatted with the same reason above
> B 2 : should be formatted because the values for the Key B is not
> uniformly equal
> B 2 : should be formatted because the values for the Key B is not
> uniformly equal even though there exists the same value with the same key
> B 3 : should be formatted because the values for the Key B is not
> uniformly equal
> C 2 : should be formatted because the values for the Key C is not
> uniformly equal
> C 4 : should be formatted because the values for the Key C is not
> uniformly equal
>
> the format formular is
> =SUMPRODUCT(($A$1:$A$10=$A1)*($B$1:$B$10=$B1)*($A$ 1:$A$10<>"")*($B$1:$B$10<>""))=1


--

Dave Peterson
 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a

 
      08-27-2007, 12:24 PM
I see you have an active thread in .newusers.

I'll bow out of this thread.

Dave Peterson wrote:
>
> I think this does what you want.
>
> Select the range you want to give that format|Conditional format. With A1 the
> activecell, use this formula:
>
> =COUNTIF($A$1:$A$10,A1)=SUMPRODUCT(--($A$1:$A$10=A1),--($B$1:$B$10=B1))
>
> Adjust the ranges to match--but you can't use whole columns (except in xl2007).
>
> =sumproduct() likes to work with numbers. The -- stuff changes trues and falses
> to 1's and 0's.
>
> Bob Phillips explains =sumproduct() in much more detail here:
> http://www.xldynamic.com/source/xld.SUMPRODUCT.html
>
> And J.E. McGimpsey has some notes at:
> http://mcgimpsey.com/excel/formulae/doubleneg.html
>
> kang wrote:
> >
> > I want to find all key-value pairs if there is key with different value.
> > in the case above
> > A 1
> > A 1
> > B 2
> > B 2
> > B 3
> > C 2
> > C 4
> > the first
> > A 1 : should not be formatted because all the values with A key are 1.
> > A 1 : should not be formatted with the same reason above
> > B 2 : should be formatted because the values for the Key B is not
> > uniformly equal
> > B 2 : should be formatted because the values for the Key B is not
> > uniformly equal even though there exists the same value with the same key
> > B 3 : should be formatted because the values for the Key B is not
> > uniformly equal
> > C 2 : should be formatted because the values for the Key C is not
> > uniformly equal
> > C 4 : should be formatted because the values for the Key C is not
> > uniformly equal
> >
> > the format formular is
> > =SUMPRODUCT(($A$1:$A$10=$A1)*($B$1:$B$10=$B1)*($A$ 1:$A$10<>"")*($B$1:$B$10<>""))=1

>
> --
>
> Dave Peterson


--

Dave Peterson
 
Reply With Quote
 
Max
Guest
Posts: n/a

 
      08-27-2007, 11:06 PM
"Dave Peterson" wrote:
>I see you have an active thread in .newusers.
>
> I'll bow out of this thread.


Dave, don't <g>. Think I've run dry of ideas for the OP over in .newusers
(in his repeat posting).
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a

 
      08-28-2007, 01:14 AM
I really hate wasting my time on multiposted messages.

Most of the time, similar suggestions are posted and it's just a waste for both
the responder and the OP.

Max wrote:
>
> "Dave Peterson" wrote:
> >I see you have an active thread in .newusers.
> >
> > I'll bow out of this thread.

>
> Dave, don't <g>. Think I've run dry of ideas for the OP over in .newusers
> (in his repeat posting).
> --
> Max
> Singapore
> http://savefile.com/projects/236895
> xdemechanik
> ---


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a powerpoint template for a matching pairs game? mathassessor PowerPoint Newsgroup 2 07-12-2008 12:11 PM
Converting String to pairs. UllSang@gmail.com Excel Newsgroup 3 05-11-2006 07:54 PM
finding out pairs of positive & negative numbers! via135 Excel Newsgroup 12 12-18-2005 05:27 AM
finding matching pairs dave wagner Excel Newsgroup 1 07-18-2005 06:04 PM
Checking of lines between 2 pairs of co-oridantes corsses Jojoba86 Excel Newsgroup 0 08-20-2003 11:35 AM



All times are GMT. The time now is 02:09 PM.