PC Review


Reply
Thread Tools Rate Thread

how to do a double lookup

 
 
kc0hwa
Guest
Posts: n/a
 
      17th Jul 2011
how to do a double lookup

countif($a$3:$a30,4) and ($b$3:$b30,5)
I know countif is countif(range,==)
but I need look in
 
Reply With Quote
 
 
 
 
GS
Guest
Posts: n/a
 
      17th Jul 2011
After serious thinking kc0hwa wrote :
> how to do a double lookup
>
> countif($a$3:$a30,4) and ($b$3:$b30,5)
> I know countif is countif(range,==)
> but I need look in


Possibly...

=SUM(COUNTIF($A$3:$A30,4),COUNTIF($B$3:$B30,5))

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


 
Reply With Quote
 
joeu2004
Guest
Posts: n/a
 
      17th Jul 2011
"kc0hwa" <(E-Mail Removed)> wrote:
> how to do a double lookup
> countif($a$3:$a30,4) and ($b$3:$b30,5)


If you want to count only the instances when both conditions are met in the
same row, then:

* For XL2007 and later:

COUNTIFS($a$3:$a30,4,$b$3:$b30,5)

* For XL2003 and earlier:

SUMPRODUCT(($a$3:$a30=4)*($b$3:$b30=5))

If you want to count when either condition is met, and you want to avoid
double-accounting when both conditions are met in the same row, then:

SUMPRODUCT(--(($a$3:$a30=4)+($b$3:$b30=5)>0))

The double-negative (--) converts TRUE and FALSE to 1 and 0, which
SUMPRODUCT requires.

Multiplication of conditional expressions acts like AND(). Addition acts
like OR(). We cannot use AND() and OR() in this context for the purposes
described above.


 
Reply With Quote
 
kc0hwa
Guest
Posts: n/a
 
      18th Jul 2011
On Jul 17, 5:35*pm, "joeu2004" <joeu2...@foo.bar> wrote:
> "kc0hwa" <kc0...@gmail.com> wrote:
> > how to do a double lookup
> > countif($a$3:$a30,4) and ($b$3:$b30,5)

>
> If you want to count only the instances when both conditions are met in the
> same row, then:
>
> * For XL2007 and later:
>
> * COUNTIFS($a$3:$a30,4,$b$3:$b30,5)
>
> * For XL2003 and earlier:
>
> * SUMPRODUCT(($a$3:$a30=4)*($b$3:$b30=5))
>
> If you want to count when either condition is met, and you want to avoid
> double-accounting when both conditions are met in the same row, then:
>
> * SUMPRODUCT(--(($a$3:$a30=4)+($b$3:$b30=5)>0))
>
> The double-negative (--) converts TRUE and FALSE to 1 and 0, which
> SUMPRODUCT requires.
>
> Multiplication of conditional expressions acts like AND(). *Addition acts
> like OR(). *We cannot use AND() and OR() in this context for the purposes
> described above.


if the cell, is string will this work
 
Reply With Quote
 
kc0hwa
Guest
Posts: n/a
 
      18th Jul 2011
will this work if the cell have text
like need a like the =countif(sumprotuce($A$3:$A5,$B$3:$B5),$A5&$B5)
 
Reply With Quote
 
joeu2004
Guest
Posts: n/a
 
      18th Jul 2011

"kc0hwa" <(E-Mail Removed)> wrote:
> On Jul 17, 5:35 pm, "joeu2004" <joeu2...@foo.bar> wrote:
> > * For XL2007 and later:
> > COUNTIFS($a$3:$a30,4,$b$3:$b30,5)
> >
> > * For XL2003 and earlier:
> > SUMPRODUCT(($a$3:$a30=4)*($b$3:$b30=5))

[....]
> > SUMPRODUCT(--(($a$3:$a30=4)+($b$3:$b30=5)>0))

[....]
> if the cell, is string will this work


The COUNTIFS works regardless of whether the cell content is text or
numeric.

The SUMPRODUCT needs to be changed as follows:

SUMPRODUCT(($a$3:$a30="4")*($b$3:$b30="5"))

or

SUMPRODUCT(--(($a$3:$a30="4")+($b$3:$b30="5")>0))

If you have further questions, please indicate what version of Excel you are
using (XL2003, XL2007, XL2010, etc) and which solution best fits your needs:
COUNTIFS, SUMPRODUCT with "*", or SUMPRODUCT with "+".

That way, I do not have to duplicate so many things.

 
Reply With Quote
 
kc0hwa
Guest
Posts: n/a
 
      18th Jul 2011
On Jul 18, 11:13*am, "joeu2004" <joeu2...@foo.bar> wrote:
> "kc0hwa" <kc0...@gmail.com> wrote:
> > On Jul 17, 5:35 pm, "joeu2004" <joeu2...@foo.bar> wrote:
> > > * For XL2007 and later:
> > > COUNTIFS($a$3:$a30,4,$b$3:$b30,5)

>
> > > * For XL2003 and earlier:
> > > SUMPRODUCT(($a$3:$a30=4)*($b$3:$b30=5))

> [....]
> > > SUMPRODUCT(--(($a$3:$a30=4)+($b$3:$b30=5)>0))

> [....]
> > if the cell, is string will this work

>
> The COUNTIFS works regardless of whether the cell content is text or
> numeric.
>
> The SUMPRODUCT needs to be changed as follows:
>
> SUMPRODUCT(($a$3:$a30="4")*($b$3:$b30="5"))
>
> or
>
> SUMPRODUCT(--(($a$3:$a30="4")+($b$3:$b30="5")>0))
>
> If you have further questions, please indicate what version of Excel you are
> using (XL2003, XL2007, XL2010, etc) and which solution best fits your needs:
> COUNTIFS, SUMPRODUCT with "*", or SUMPRODUCT with "+".
>
> That way, I do not have to duplicate so many things.


ya THAT IS NOT WORKING

COUNT FROM TOP DOWN FOR X

X=CONCATENATE(A30,D30)
=COUNTIF(CONCATENATE(A2:A30,D230),CONCATENATE(A30,D30))
 
Reply With Quote
 
kc0hwa
Guest
Posts: n/a
 
      18th Jul 2011
On Jul 18, 11:13*am, "joeu2004" <joeu2...@foo.bar> wrote:
> "kc0hwa" <kc0...@gmail.com> wrote:
> > On Jul 17, 5:35 pm, "joeu2004" <joeu2...@foo.bar> wrote:
> > > * For XL2007 and later:
> > > COUNTIFS($a$3:$a30,4,$b$3:$b30,5)

>
> > > * For XL2003 and earlier:
> > > SUMPRODUCT(($a$3:$a30=4)*($b$3:$b30=5))

> [....]
> > > SUMPRODUCT(--(($a$3:$a30=4)+($b$3:$b30=5)>0))

> [....]
> > if the cell, is string will this work

>
> The COUNTIFS works regardless of whether the cell content is text or
> numeric.
>
> The SUMPRODUCT needs to be changed as follows:
>
> SUMPRODUCT(($a$3:$a30="4")*($b$3:$b30="5"))
>
> or
>
> SUMPRODUCT(--(($a$3:$a30="4")+($b$3:$b30="5")>0))
>
> If you have further questions, please indicate what version of Excel you are
> using (XL2003, XL2007, XL2010, etc) and which solution best fits your needs:
> COUNTIFS, SUMPRODUCT with "*", or SUMPRODUCT with "+".
>
> That way, I do not have to duplicate so many things.


ya THAT IS NOT WORKING
COUNT FROM TOP DOWN FOR X
X=CONCATENATE(A30,D30)
=COUNTIF(CONCATENATE(A2:A30,D230),CONCATENATE(A30,D30))
OR

COUNTIF(($A$2:$A40,$A40) AND (COUNTIF($D$2:$D40,$D40))
 
Reply With Quote
 
kc0hwa
Guest
Posts: n/a
 
      19th Jul 2011
so if there is information is a40 and there is information in d40 I
can not and to count from a2:a40,d2:d40 for the number of time both
hapons
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Double Lookup ryguy7272 Microsoft Excel Worksheet Functions 5 13th Jul 2009 09:42 PM
Variable Lookup/Double Lookup Ryan Microsoft Excel Worksheet Functions 8 14th May 2007 09:44 PM
Double lookup =?Utf-8?B?TWF0dFBycGljaA==?= Microsoft Excel Programming 2 28th Nov 2006 01:35 PM
double lookup bg Microsoft Excel Misc 4 11th Aug 2004 11:40 AM
Double Lookup Jim Palmer Microsoft Excel Worksheet Functions 6 8th May 2004 05:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:46 PM.