Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,814
Default Simple ? countif, 3 separate conditions across multi tabs

If I have 26 tabs A:Z,
and in the P columns of each tab, there are various numbers such as:

0,-100, -400,-70, 100, 400, 70, etc.

I'd like to count how many a
between -100 and +100 &
bewteen -399 and + 399 ( not including the -100/+100 above) &
<-400 and 400.

Thanks,

Steve

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 622
Default Simple ? countif, 3 separate conditions across multi tabs

On Jan 2, 9:46*am, Steve wrote:
If I have 26 tabs A:Z,
and in the P columns of each tab, there are various numbers such as:

0,-100, -400,-70, 100, 400, 70, etc.

I'd like to count how many a
between -100 and +100 * &
bewteen -399 and + 399 ( not including the -100/+100 above) * &
<-400 and 400.

Thanks,

Steve


=SUMPRODUCT(--(ABS(P1:P100)<=100))
=SUMPRODUCT(--(ABS(P1:P100)<=400))-SUMPRODUCT(--(ABS(P1:P100)<=100))
=SUMPRODUCT(--(ABS(P1:P100)400))

Although this will count blank cells, too. Is that an issue? And I'm
not sure where you wanted the "equal to" counted, you weren't clear on
that.
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,814
Default Simple ? countif, 3 separate conditions across multi tabs

I can't seem to get it to work. The formula cell will be on a different tab
than what's to be counted, but I want it to count the P column on 26 other
tabs, such as 'A:Z'!
Though I can't even get it to work on just one of the tabs, such as:
=SUMPRODUCT 'A'! (--(ABS(P1:P100)<=100))

Do I have the tab identifier 'A'! wrong, or will sumproduct even work across
multi tabs ? Though if that is the case, I guess I could use these formulas
on each tab, then count each of the appropraite cells on the rollup tab.
Counting blank cells would be an issue. What would they get counted as ?

The = to can probably be removed, as the < account for it as I needed.

Thanks,

"Spiky" wrote:

On Jan 2, 9:46 am, Steve wrote:
If I have 26 tabs A:Z,
and in the P columns of each tab, there are various numbers such as:

0,-100, -400,-70, 100, 400, 70, etc.

I'd like to count how many a
between -100 and +100 &
bewteen -399 and + 399 ( not including the -100/+100 above) &
<-400 and 400.

Thanks,

Steve


=SUMPRODUCT(--(ABS(P1:P100)<=100))
=SUMPRODUCT(--(ABS(P1:P100)<=400))-SUMPRODUCT(--(ABS(P1:P100)<=100))
=SUMPRODUCT(--(ABS(P1:P100)400))

Although this will count blank cells, too. Is that an issue? And I'm
not sure where you wanted the "equal to" counted, you weren't clear on
that.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Simple ? countif, 3 separate conditions across multi tabs

Steve,

it won't work well across multiple tabs (and your attempted amendment
has the wrong syntax), so put these formulae in the same cells in each
tab, eg:

X1: =SUMPRODUCT(--(ABS(P1:P100)<=100),--(P1:P100<""))
Y1: =SUMPRODUCT(--(ABS(P1:P100)<400))-X1
Z1: =SUMPRODUCT(--(ABS(P1:P100)=400))

If you group the sheets A to Z together first (by selecting sheet A,
holding the SHIFT key down and clicking on the Z sheet tab), then you
will only need to type the formula once into X1, Y1 and Z1. Remember
to ungroup the sheets afterwards, by right-clicking on a sheet tab and
selecting Ungroup sheets).

Then you can combine them on your summary sheet like this:

=SUM(A:Z!X1)
=SUM(A:Z!Y1)
=SUM(A:Z!Z1)

Hope this helps.

Pete



On Jan 2, 4:47*pm, Steve wrote:
I can't seem to get it to work. *The formula cell will be on a different tab
than what's to be counted, but I want it to count the P column on 26 other
tabs, such as 'A:Z'!
Though I can't even get it to work on just one of the tabs, such as:
=SUMPRODUCT * * 'A'! * *(--(ABS(P1:P100)<=100))

Do I have the tab identifier 'A'! wrong, or will sumproduct even work across
multi tabs ? Though if that is the case, I guess I could use these formulas
on each tab, then count each of the appropraite cells on the rollup tab.
Counting blank cells would be an issue. What would they get counted as ?

The = to can probably be removed, as the < account for it as I needed.

Thanks,



"Spiky" wrote:
On Jan 2, 9:46 am, Steve wrote:
If I have 26 tabs A:Z,
and in the P columns of each tab, there are various numbers such as:


0,-100, -400,-70, 100, 400, 70, etc.


I'd like to count how many a
between -100 and +100 * &
bewteen -399 and + 399 ( not including the -100/+100 above) * &
<-400 and 400.


Thanks,


Steve


=SUMPRODUCT(--(ABS(P1:P100)<=100))
=SUMPRODUCT(--(ABS(P1:P100)<=400))-SUMPRODUCT(--(ABS(P1:P100)<=100))
=SUMPRODUCT(--(ABS(P1:P100)400))


Although this will count blank cells, too. Is that an issue? And I'm
not sure where you wanted the "equal to" counted, you weren't clear on
that.- Hide quoted text -


- Show quoted text -


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,814
Default Simple ? countif, 3 separate conditions across multi tabs

Almost there. X1 is working great. But Y1 & Z1 not quite there yet.
Y1 should be counting between -399 and + 399, not including the X1 (-X1)
Z1 should be counting anything <400 and anything 400.

Gottit on the shifting and the combining on the summary.

Steve

"Pete_UK" wrote:

Steve,

it won't work well across multiple tabs (and your attempted amendment
has the wrong syntax), so put these formulae in the same cells in each
tab, eg:

X1: =SUMPRODUCT(--(ABS(P1:P100)<=100),--(P1:P100<""))
Y1: =SUMPRODUCT(--(ABS(P1:P100)<400))-X1
Z1: =SUMPRODUCT(--(ABS(P1:P100)=400))

If you group the sheets A to Z together first (by selecting sheet A,
holding the SHIFT key down and clicking on the Z sheet tab), then you
will only need to type the formula once into X1, Y1 and Z1. Remember
to ungroup the sheets afterwards, by right-clicking on a sheet tab and
selecting Ungroup sheets).

Then you can combine them on your summary sheet like this:

=SUM(A:Z!X1)
=SUM(A:Z!Y1)
=SUM(A:Z!Z1)

Hope this helps.

Pete



On Jan 2, 4:47 pm, Steve wrote:
I can't seem to get it to work. The formula cell will be on a different tab
than what's to be counted, but I want it to count the P column on 26 other
tabs, such as 'A:Z'!
Though I can't even get it to work on just one of the tabs, such as:
=SUMPRODUCT 'A'! (--(ABS(P1:P100)<=100))

Do I have the tab identifier 'A'! wrong, or will sumproduct even work across
multi tabs ? Though if that is the case, I guess I could use these formulas
on each tab, then count each of the appropraite cells on the rollup tab.
Counting blank cells would be an issue. What would they get counted as ?

The = to can probably be removed, as the < account for it as I needed.

Thanks,



"Spiky" wrote:
On Jan 2, 9:46 am, Steve wrote:
If I have 26 tabs A:Z,
and in the P columns of each tab, there are various numbers such as:


0,-100, -400,-70, 100, 400, 70, etc.


I'd like to count how many a
between -100 and +100 &
bewteen -399 and + 399 ( not including the -100/+100 above) &
<-400 and 400.


Thanks,


Steve


=SUMPRODUCT(--(ABS(P1:P100)<=100))
=SUMPRODUCT(--(ABS(P1:P100)<=400))-SUMPRODUCT(--(ABS(P1:P100)<=100))
=SUMPRODUCT(--(ABS(P1:P100)400))


Although this will count blank cells, too. Is that an issue? And I'm
not sure where you wanted the "equal to" counted, you weren't clear on
that.- Hide quoted text -


- Show quoted text -





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Simple ? countif, 3 separate conditions across multi tabs

Okay, Steve, try these amendments to ignore blank cells in all cases:

X1: =SUMPRODUCT(--(ABS(P1:P100)<=100),--(P1:P100<""))
Y1: =SUMPRODUCT(--(ABS(P1:P100)<400),--(P1:P100<""))-X1
Z1: =SUMPRODUCT(--(ABS(P1:P100)=400),--(P1:P100<""))

Other instructions as before.

Hope this helps.

Pete

On Jan 2, 5:36*pm, Steve wrote:
Almost there. X1 is working great. But Y1 & Z1 not quite there yet.
Y1 should be counting between -399 and + 399, not including the X1 (-X1)
Z1 should be counting anything <400 and anything 400.

Gottit on the shifting and the combining on the summary.

Steve



"Pete_UK" wrote:
Steve,


it won't work well across multiple tabs (and your attempted amendment
has the wrong syntax), so put these formulae in the same cells in each
tab, eg:


X1: * * =SUMPRODUCT(--(ABS(P1:P100)<=100),--(P1:P100<""))
Y1: * *=SUMPRODUCT(--(ABS(P1:P100)<400))-X1
Z1: * * =SUMPRODUCT(--(ABS(P1:P100)=400))


If you group the sheets A to Z together first (by selecting sheet A,
holding the SHIFT key down and clicking on the Z sheet tab), then you
will only need to type the formula once into X1, Y1 and Z1. Remember
to ungroup the sheets afterwards, by right-clicking on a sheet tab and
selecting Ungroup sheets).


Then you can combine them on your summary sheet like this:


=SUM(A:Z!X1)
=SUM(A:Z!Y1)
=SUM(A:Z!Z1)


Hope this helps.


Pete


On Jan 2, 4:47 pm, Steve wrote:
I can't seem to get it to work. *The formula cell will be on a different tab
than what's to be counted, but I want it to count the P column on 26 other
tabs, such as 'A:Z'!
Though I can't even get it to work on just one of the tabs, such as:
=SUMPRODUCT * * 'A'! * *(--(ABS(P1:P100)<=100))


Do I have the tab identifier 'A'! wrong, or will sumproduct even work across
multi tabs ? Though if that is the case, I guess I could use these formulas
on each tab, then count each of the appropraite cells on the rollup tab.
Counting blank cells would be an issue. What would they get counted as ?


The = to can probably be removed, as the < account for it as I needed.


Thanks,


"Spiky" wrote:
On Jan 2, 9:46 am, Steve wrote:
If I have 26 tabs A:Z,
and in the P columns of each tab, there are various numbers such as:


0,-100, -400,-70, 100, 400, 70, etc.


I'd like to count how many a
between -100 and +100 * &
bewteen -399 and + 399 ( not including the -100/+100 above) * &
<-400 and 400.


Thanks,


Steve


=SUMPRODUCT(--(ABS(P1:P100)<=100))
=SUMPRODUCT(--(ABS(P1:P100)<=400))-SUMPRODUCT(--(ABS(P1:P100)<=100))
=SUMPRODUCT(--(ABS(P1:P100)400))


Although this will count blank cells, too. Is that an issue? And I'm
not sure where you wanted the "equal to" counted, you weren't clear on
that.- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 622
Default Simple ? countif, 3 separate conditions across multi tabs

On Jan 2, 10:47*am, Steve wrote:
I can't seem to get it to work. *The formula cell will be on a different tab
than what's to be counted, but I want it to count the P column on 26 other
tabs, such as 'A:Z'!

I had assumed you were going to use 26 different cells to see the
count for each sheet individually, too. Do you want it all in one
formula? Sumproduct can't do 3D ranges, and I don't think other built-
in functions can, either. I think you would have to repeat the formula
26 times in one cell. Or use a UDF that can handle 3D better. See the
very bottom.

Though I can't even get it to work on just one of the tabs, such as:
=SUMPRODUCT * * 'A'! * *(--(ABS(P1:P100)<=100))

You need to put the sheet next to the range.
=SUMPRODUCT(--(ABS('A'!P1:P100)<=100))


Counting blank cells would be an issue. What would they get counted as ?

They would be included in the <100 count, because it will assume they
are zeroes. So you can add another calc to get rid of them. There's a
couple ways to do it, here's one:
=SUMPRODUCT(--(ABS('A'!P1:P100)<=100))-SUMPRODUCT(--('A'!P1:P100=""))

The = to can probably be removed, as the < account for it as I needed.

At some point I think you need the =. Otherwise it will not count 100
and 400.


So, after all that, here is a single formula that can give you the
first item, counting items from -100 and 100, inclusive, on all
sheets. This includes a UDF from morefunc. You can find morefunc via
Google or download.com.
=SUMPRODUCT(--(ABS(--THREED('A:Z'!A1:A29))<=100))-SUMPRODUCT(--(THREED
('A:Z'!A1:A29)=""))
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Simple ? countif, 3 separate conditions across multi tabs

Hi,

In 2003 if you want to exclude blank cells from the counts, enter these
three formulas on each sheet:

=SUMPRODUCT(--(A1:A12=-100),--(A1:A12<=100),--(A1:A12<""))
=SUMPRODUCT(--(A1:A12=-300),--(A1:A12<=300),--(A1:A12<""))-C11
=COUNT(A1:A12)-SUM(C11:C12)

In each case the range to look at is column A. In this example the first
formula is in C11, the second in C12.

In 2007
=COUNTIFS(A1:A12,"=-100",A1:A12,"<=100",A1:A12,"<")
=COUNTIFS(A1:A12,"=-399",A1:A12,"<=399",A1:A12,"<")-C11
and the third formula is unchanged from the 2003 version.

Formulas in the same locations as in the 2003 examples.

To sum these results to a summary page
=SUM(A:Z!C11)
=SUM(A:Z!C12)
=SUM(A:Z!C13)
--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Steve" wrote:

If I have 26 tabs A:Z,
and in the P columns of each tab, there are various numbers such as:

0,-100, -400,-70, 100, 400, 70, etc.

I'd like to count how many a
between -100 and +100 &
bewteen -399 and + 399 ( not including the -100/+100 above) &
<-400 and 400.

Thanks,

Steve

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,814
Default Simple ? countif, 3 separate conditions across multi tabs

Thanks guys,

They all worked great. Much appreciated.
Have a great year.

Steve

"Shane Devenshire" wrote:

Hi,

In 2003 if you want to exclude blank cells from the counts, enter these
three formulas on each sheet:

=SUMPRODUCT(--(A1:A12=-100),--(A1:A12<=100),--(A1:A12<""))
=SUMPRODUCT(--(A1:A12=-300),--(A1:A12<=300),--(A1:A12<""))-C11
=COUNT(A1:A12)-SUM(C11:C12)

In each case the range to look at is column A. In this example the first
formula is in C11, the second in C12.

In 2007
=COUNTIFS(A1:A12,"=-100",A1:A12,"<=100",A1:A12,"<")
=COUNTIFS(A1:A12,"=-399",A1:A12,"<=399",A1:A12,"<")-C11
and the third formula is unchanged from the 2003 version.

Formulas in the same locations as in the 2003 examples.

To sum these results to a summary page
=SUM(A:Z!C11)
=SUM(A:Z!C12)
=SUM(A:Z!C13)
--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Steve" wrote:

If I have 26 tabs A:Z,
and in the P columns of each tab, there are various numbers such as:

0,-100, -400,-70, 100, 400, 70, etc.

I'd like to count how many a
between -100 and +100 &
bewteen -399 and + 399 ( not including the -100/+100 above) &
<-400 and 400.

Thanks,

Steve

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
Countif Conditions - Use of conditions that vary by cell value JonTarg Excel Discussion (Misc queries) 1 May 30th 08 01:21 PM
Funtion multi conditions Aline Excel Worksheet Functions 5 February 28th 08 10:39 PM
Multi Column Sum and conditions kalim Excel Worksheet Functions 1 May 23rd 06 03:06 PM
SUMPRODUCT + multi conditions BernzG Excel Worksheet Functions 3 May 10th 06 02:23 AM
Multi-conditions with SUMPRODUCT and COUNTIF MikeDH Excel Worksheet Functions 2 August 16th 05 02:06 AM


All times are GMT +1. The time now is 06:06 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"