A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Count non-consecutive cells.....



 
 
Thread Tools Display Modes
  #1  
Old September 25th, 2004, 08:49 PM
Zadig Galbaras
external usenet poster
 
Posts: n/a
Default Count non-consecutive cells.....

Hi!

I have this spreadsheet looking kind alike this:

A1=X

B1=""
D1=X
F1=""
H1=X
J1=""
L1=X
N1=X
"" = empty

P1=?

How can I, in P1 count how many of the cells B1, D1, F1, H1, J1, L1 and N1
is identical with A1?`
Count or countif do not work on non-consecutive cells I think.
This is vital because the cells in-between, i.e. C1, E1, G1, I1, K1, and M1
is already in use for other purposes.
There is in total seven cells I want to check how many are identical with
A1.

As you experts out there already have found out, I am no expert :-))


--


Zadig Galbaras
A Perturbed Norwegian Agnostic



  #2  
Old September 25th, 2004, 09:03 PM
Frank Kabel
external usenet poster
 
Posts: n/a
Default

Hi
try
=SUMPRODUCT(--(B1:N1=A1),--(MOD(COLUMN(B1:N1),2)=0))

--
Regards
Frank Kabel
Frankfurt, Germany

"Zadig Galbaras" schrieb im Newsbeitrag
...
Hi!

I have this spreadsheet looking kind alike this:

A1=X

B1=""
D1=X
F1=""
H1=X
J1=""
L1=X
N1=X
"" = empty

P1=?

How can I, in P1 count how many of the cells B1, D1, F1, H1, J1, L1

and N1
is identical with A1?`
Count or countif do not work on non-consecutive cells I think.
This is vital because the cells in-between, i.e. C1, E1, G1, I1, K1,

and M1
is already in use for other purposes.
There is in total seven cells I want to check how many are identical

with
A1.

As you experts out there already have found out, I am no expert :-))


--


Zadig Galbaras
A Perturbed Norwegian Agnostic




  #3  
Old September 25th, 2004, 10:18 PM
Aladin Akyurek
external usenet poster
 
Posts: n/a
Default

=SUMPRODUCT(--(MOD(COLUMN($B$1:$N$1)-CELL("Col",$B$1)+0,2)=0),--($B$1:$N$1=A1))"Zadig Galbaras" wrote in .. . Hi! I have this spreadsheet looking kind alike this: A1=X B1="" D1=X F1="" H1=X J1="" L1=X N1=X "" = empty P1=? How can I, in P1 count how many of the cells B1, D1, F1, H1, J1, L1 and N1is identical with A1?` Count or countif do not work on non-consecutive cells I think. This is vital because the cells in-between, i.e. C1, E1, G1, I1, K1, andM1 is already in use for other purposes. There is in total seven cells I want to check how many are identical withA1. As you experts out there already have found out, I am no expert :-)) -- Zadig Galbaras A Perturbed Norwegian Agnostic

  #4  
Old September 26th, 2004, 12:22 AM
Zadig Galbaras
external usenet poster
 
Posts: n/a
Default

well thank you to both of you :-)

Nice solutions, but in my ignorance I made out an example with a fixed
number of cells in-between the important ones.
So your formula did work properly, and came up with the wrong answer....
I changed the divisor in the MOG function from 2 to 10 and voila it worked.

But the number which came up didn't do it :-(
Thst's my fault!!

So I did some brain work and came up with a working solution:

=IF(O33"";COUNT.IF(S33;O33)+COUNT.IF(AC33;O33)+C OUNT.IF(AM33;O33)+COUNT.IF(AW33;O33)+COUNT.IF(BG33 ;O33)+COUNT.IF(BQ33;O33)+COUNT.IF(CA33;O33);"")

Here O33 is teh cell containg the value all others are compared with.
So IF S33 is excatly the same as O33 then count it, if not, do not count it!


I know it's amateurish, but in my world i works :-)

Is there a better way to do this?

--


Zadig Galbaras
A Perturbed Norwegian Agnostic


  #5  
Old September 26th, 2004, 07:21 AM
Frank Kabel
external usenet poster
 
Posts: n/a
Default

Hi
try:
=SUMPRODUCT(--(S33:CA33=O33),--(MOD(COLUMN(S33:CA33)-19,10)=0))

--
Regards
Frank Kabel
Frankfurt, Germany

"Zadig Galbaras" schrieb im Newsbeitrag
...
well thank you to both of you :-)

Nice solutions, but in my ignorance I made out an example with a

fixed
number of cells in-between the important ones.
So your formula did work properly, and came up with the wrong

answer....
I changed the divisor in the MOG function from 2 to 10 and voila it

worked.

But the number which came up didn't do it :-(
Thst's my fault!!

So I did some brain work and came up with a working solution:


=IF(O33"";COUNT.IF(S33;O33)+COUNT.IF(AC33;O33)+C OUNT.IF(AM33;O33)+COU
NT.IF(AW33;O33)+COUNT.IF(BG33;O33)+COUNT.IF(BQ33;O 33)+COUNT.IF(CA33;O33
);"")

Here O33 is teh cell containg the value all others are compared with.
So IF S33 is excatly the same as O33 then count it, if not, do not

count it!


I know it's amateurish, but in my world i works :-)

Is there a better way to do this?

--


Zadig Galbaras
A Perturbed Norwegian Agnostic



  #6  
Old September 26th, 2004, 09:26 AM
Aladin Akyurek
external usenet poster
 
Posts: n/a
Default

Since the data cells you test are regularly spaced, you can still exploit
the formula I provided:

=IF(O33"",SUMPRODUCT(--(MOD(COLUMN($S$33:$CA$33)-CELL("Col",$S$33)+0,10)=0),--($S$33:$CA$33=O33))

"Zadig Galbaras" wrote in message
...
well thank you to both of you :-)

Nice solutions, but in my ignorance I made out an example with a fixed
number of cells in-between the important ones.
So your formula did work properly, and came up with the wrong answer....
I changed the divisor in the MOG function from 2 to 10 and voila it
worked.

But the number which came up didn't do it :-(
Thst's my fault!!

So I did some brain work and came up with a working solution:

=IF(O33"";COUNT.IF(S33;O33)+COUNT.IF(AC33;O33)+C OUNT.IF(AM33;O33)+COUNT.IF(AW33;O33)+COUNT.IF(BG33 ;O33)+COUNT.IF(BQ33;O33)+COUNT.IF(CA33;O33);"")

Here O33 is teh cell containg the value all others are compared with.
So IF S33 is excatly the same as O33 then count it, if not, do not count
it!


I know it's amateurish, but in my world i works :-)

Is there a better way to do this?

--


Zadig Galbaras
A Perturbed Norwegian Agnostic



  #7  
Old September 26th, 2004, 09:36 AM
Frank Kabel
external usenet poster
 
Posts: n/a
Default

Hi Aladin
just a curious question: Why add '0' in your formula?

--
Regards
Frank Kabel
Frankfurt, Germany

"Aladin Akyurek" schrieb im Newsbeitrag
...
Since the data cells you test are regularly spaced, you can still

exploit
the formula I provided:


=IF(O33"",SUMPRODUCT(--(MOD(COLUMN($S$33:$CA$33)-CELL("Col",$S$33)+0,
10)=0),--($S$33:$CA$33=O33))


  #8  
Old September 26th, 2004, 10:48 AM
Aladin Akyurek
external usenet poster
 
Posts: n/a
Default

If you set that value to 1, it will ignore the first cell of the range of
interest.

"Frank Kabel" wrote in message
...
Hi Aladin
just a curious question: Why add '0' in your formula?

--
Regards
Frank Kabel
Frankfurt, Germany

"Aladin Akyurek" schrieb im Newsbeitrag
...
Since the data cells you test are regularly spaced, you can still

exploit
the formula I provided:


=IF(O33"",SUMPRODUCT(--(MOD(COLUMN($S$33:$CA$33)-CELL("Col",$S$33)+0,
10)=0),--($S$33:$CA$33=O33))




 




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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SUBTOTAL Second Count / sub-count of Filtered Visible Cells QTE Worksheet Functions 0 July 27th, 2004 08:47 PM
Excel count cells in range with text Tprob Worksheet Functions 0 May 12th, 2004 04:58 PM
How do I count cells with data? Vasant Nanavati Worksheet Functions 3 April 21st, 2004 11:54 AM
count cells that fall within a range of numbers Dan E Worksheet Functions 1 November 18th, 2003 05:04 PM


All times are GMT +1. The time now is 12:54 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.