PC Review


Reply
Thread Tools Rate Thread

COUNTIF & Criteria

 
 
David Lipetz
Guest
Posts: n/a
 
      16th Dec 2005
I'm using the SUMIF function to add numbers in a range that meet a given
criteria. The criteria I need to use is a range of numbers (>=1 and <=5, >=6
and <=10, etc).

While I have been able to perform this calculation by hard coding in the
parameters (">=1" and ">5" for example), I am unable to complete the formula
if I want to use cell references for the criteria.

Here is the whole formula that currently works by hard coding in the
criteria:

=COUNTIF(Revised!$A$2:$A$336,">=1")-COUNTIF(Revised!$A$2:$A$336,">5")

In other words, I want to use >=G2 rather than >=1 and use >I2 rather than
>5.


How do I accomplish this?

Thanks,
David


 
Reply With Quote
 
 
 
 
Peo Sjoblom
Guest
Posts: n/a
 
      16th Dec 2005
Try

=COUNTIF(Revised!$A$2:$A$336,">="&G2)-COUNTIF(Revised!$A$2:$A$336,">"&I2)

otherwise excel sees it as you are looking for the text G2 and I2


--

Regards,

Peo Sjoblom

"David Lipetz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm using the SUMIF function to add numbers in a range that meet a given
> criteria. The criteria I need to use is a range of numbers (>=1 and <=5,
>=6
> and <=10, etc).
>
> While I have been able to perform this calculation by hard coding in the
> parameters (">=1" and ">5" for example), I am unable to complete the

formula
> if I want to use cell references for the criteria.
>
> Here is the whole formula that currently works by hard coding in the
> criteria:
>
> =COUNTIF(Revised!$A$2:$A$336,">=1")-COUNTIF(Revised!$A$2:$A$336,">5")
>
> In other words, I want to use >=G2 rather than >=1 and use >I2 rather than
> >5.

>
> How do I accomplish this?
>
> Thanks,
> David
>
>



 
Reply With Quote
 
David Lipetz
Guest
Posts: n/a
 
      16th Dec 2005
Correction to my post:
I am using COUNTIF not SUMIF.


"David Lipetz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm using the SUMIF function to add numbers in a range that meet a given
> criteria. The criteria I need to use is a range of numbers (>=1 and <=5,
> >=6 and <=10, etc).

>
> While I have been able to perform this calculation by hard coding in the
> parameters (">=1" and ">5" for example), I am unable to complete the
> formula if I want to use cell references for the criteria.
>
> Here is the whole formula that currently works by hard coding in the
> criteria:
>
> =COUNTIF(Revised!$A$2:$A$336,">=1")-COUNTIF(Revised!$A$2:$A$336,">5")
>
> In other words, I want to use >=G2 rather than >=1 and use >I2 rather than
> >5.

>
> How do I accomplish this?
>
> Thanks,
> David
>



 
Reply With Quote
 
David Lipetz
Guest
Posts: n/a
 
      16th Dec 2005
Thanks Peo! That worked, but now I have another problem.

I wanted to create this as an array formula so that the criteria is selected
from each row: G2 & I2, G3 & I3, and so forth. With the & in front of the
cell reference, it uses that same reference throughout the array.


"Peo Sjoblom" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Try
>
> =COUNTIF(Revised!$A$2:$A$336,">="&G2)-COUNTIF(Revised!$A$2:$A$336,">"&I2)
>
> otherwise excel sees it as you are looking for the text G2 and I2
>
>
> --
>
> Regards,
>
> Peo Sjoblom
>
> "David Lipetz" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> I'm using the SUMIF function to add numbers in a range that meet a given
>> criteria. The criteria I need to use is a range of numbers (>=1 and <=5,
>>=6
>> and <=10, etc).
>>
>> While I have been able to perform this calculation by hard coding in the
>> parameters (">=1" and ">5" for example), I am unable to complete the

> formula
>> if I want to use cell references for the criteria.
>>
>> Here is the whole formula that currently works by hard coding in the
>> criteria:
>>
>> =COUNTIF(Revised!$A$2:$A$336,">=1")-COUNTIF(Revised!$A$2:$A$336,">5")
>>
>> In other words, I want to use >=G2 rather than >=1 and use >I2 rather
>> than
>> >5.

>>
>> How do I accomplish this?
>>
>> Thanks,
>> David
>>
>>

>
>



 
Reply With Quote
 
Peo Sjoblom
Guest
Posts: n/a
 
      16th Dec 2005
I am not sure I understand, but maybe

=SUM(COUNTIF(Revised!$A$2:$A$336,">="&G2:G336))-SUM(COUNTIF(Revised!$A$2:$A$
336,">"&I2:I336))

needs to be array entered with ctrl + shift & enter




--

Regards,

Peo Sjoblom

"David Lipetz" <(E-Mail Removed)> wrote in message
news:uv%(E-Mail Removed)...
> Thanks Peo! That worked, but now I have another problem.
>
> I wanted to create this as an array formula so that the criteria is

selected
> from each row: G2 & I2, G3 & I3, and so forth. With the & in front of the
> cell reference, it uses that same reference throughout the array.
>
>
> "Peo Sjoblom" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > Try
> >
> >

=COUNTIF(Revised!$A$2:$A$336,">="&G2)-COUNTIF(Revised!$A$2:$A$336,">"&I2)
> >
> > otherwise excel sees it as you are looking for the text G2 and I2
> >
> >
> > --
> >
> > Regards,
> >
> > Peo Sjoblom
> >
> > "David Lipetz" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> I'm using the SUMIF function to add numbers in a range that meet a

given
> >> criteria. The criteria I need to use is a range of numbers (>=1 and

<=5,
> >>=6
> >> and <=10, etc).
> >>
> >> While I have been able to perform this calculation by hard coding in

the
> >> parameters (">=1" and ">5" for example), I am unable to complete the

> > formula
> >> if I want to use cell references for the criteria.
> >>
> >> Here is the whole formula that currently works by hard coding in the
> >> criteria:
> >>
> >> =COUNTIF(Revised!$A$2:$A$336,">=1")-COUNTIF(Revised!$A$2:$A$336,">5")
> >>
> >> In other words, I want to use >=G2 rather than >=1 and use >I2 rather
> >> than
> >> >5.
> >>
> >> How do I accomplish this?
> >>
> >> Thanks,
> >> David
> >>
> >>

> >
> >

>
>



 
Reply With Quote
 
David Lipetz
Guest
Posts: n/a
 
      16th Dec 2005
Thanks again! The actual formula is:
=SUMIF(Revised!$A$2:$A$335,">="&A2:A8,Revised!$L$2:$L$335)-SUMIF(Revised!$A$2:$A$335,">"&C2:C8,Revised!$L$2:$L$335)


"Peo Sjoblom" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am not sure I understand, but maybe
>
> =SUM(COUNTIF(Revised!$A$2:$A$336,">="&G2:G336))-SUM(COUNTIF(Revised!$A$2:$A$
> 336,">"&I2:I336))
>
> needs to be array entered with ctrl + shift & enter
>
>
>
>
> --
>
> Regards,
>
> Peo Sjoblom
>
> "David Lipetz" <(E-Mail Removed)> wrote in message
> news:uv%(E-Mail Removed)...
>> Thanks Peo! That worked, but now I have another problem.
>>
>> I wanted to create this as an array formula so that the criteria is

> selected
>> from each row: G2 & I2, G3 & I3, and so forth. With the & in front of the
>> cell reference, it uses that same reference throughout the array.
>>
>>
>> "Peo Sjoblom" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>> > Try
>> >
>> >

> =COUNTIF(Revised!$A$2:$A$336,">="&G2)-COUNTIF(Revised!$A$2:$A$336,">"&I2)
>> >
>> > otherwise excel sees it as you are looking for the text G2 and I2
>> >
>> >
>> > --
>> >
>> > Regards,
>> >
>> > Peo Sjoblom
>> >
>> > "David Lipetz" <(E-Mail Removed)> wrote in message
>> > news:(E-Mail Removed)...
>> >> I'm using the SUMIF function to add numbers in a range that meet a

> given
>> >> criteria. The criteria I need to use is a range of numbers (>=1 and

> <=5,
>> >>=6
>> >> and <=10, etc).
>> >>
>> >> While I have been able to perform this calculation by hard coding in

> the
>> >> parameters (">=1" and ">5" for example), I am unable to complete the
>> > formula
>> >> if I want to use cell references for the criteria.
>> >>
>> >> Here is the whole formula that currently works by hard coding in the
>> >> criteria:
>> >>
>> >> =COUNTIF(Revised!$A$2:$A$336,">=1")-COUNTIF(Revised!$A$2:$A$336,">5")
>> >>
>> >> In other words, I want to use >=G2 rather than >=1 and use >I2 rather
>> >> than
>> >> >5.
>> >>
>> >> How do I accomplish this?
>> >>
>> >> Thanks,
>> >> David
>> >>
>> >>
>> >
>> >

>>
>>

>
>



 
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
Countif with more than one criteria =?Utf-8?B?Sm9jbw==?= Microsoft Excel Misc 2 14th Jun 2007 11:38 AM
Several Countif criteria =?Utf-8?B?TWFydGlu?= Microsoft Excel Worksheet Functions 2 12th May 2006 09:44 AM
Countif W/ 2 Criteria =?Utf-8?B?Y2FybA==?= Microsoft Excel Worksheet Functions 2 3rd May 2005 10:33 PM
Countif using format criteria not number criteria? =?Utf-8?B?UnVtYmxhNzY=?= Microsoft Excel Worksheet Functions 1 20th Apr 2005 05:38 AM
Countif using format criteria....not number criteria? =?Utf-8?B?VHJveQ==?= Microsoft Excel Worksheet Functions 1 20th Apr 2005 04:50 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:58 AM.