Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 270
Default Sumproduct (I think?)

I have two ranges A1:A100, B1:B100 each containing single digit numbers
typically between 3 and 8. (No blank cells.
I would like to count all the instances of each time row B contains a number
one less than that in the equivalent A cell. eg if A5 contains 6 and B5
contains 5 then that would count as one instance. The pairs have to be the
same numbers. further eg A10 containing 6 and B10 containing 5 would count
as a second instance but A12 containing 7 and B12 containing 6 would not. Am
I making sense?
TIA
Sandy


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default Sumproduct (I think?)

I would create a helper column, say in Column C, with the following formula:
=IF(A1=B1+5,1,0) and fill that down, then sum column C. That sum would be
your count of rows for which the value in column A is one more than the value
in column C.

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"Sandy" wrote:

I have two ranges A1:A100, B1:B100 each containing single digit numbers
typically between 3 and 8. (No blank cells.
I would like to count all the instances of each time row B contains a number
one less than that in the equivalent A cell. eg if A5 contains 6 and B5
contains 5 then that would count as one instance. The pairs have to be the
same numbers. further eg A10 containing 6 and B10 containing 5 would count
as a second instance but A12 containing 7 and B12 containing 6 would not. Am
I making sense?
TIA
Sandy



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default Sumproduct (I think?)

I mean: That sum would be your count of rows for which the value in column A
is one more than the value in column B.

--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"Dave F" wrote:

I would create a helper column, say in Column C, with the following formula:
=IF(A1=B1+5,1,0) and fill that down, then sum column C. That sum would be
your count of rows for which the value in column A is one more than the value
in column C.

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"Sandy" wrote:

I have two ranges A1:A100, B1:B100 each containing single digit numbers
typically between 3 and 8. (No blank cells.
I would like to count all the instances of each time row B contains a number
one less than that in the equivalent A cell. eg if A5 contains 6 and B5
contains 5 then that would count as one instance. The pairs have to be the
same numbers. further eg A10 containing 6 and B10 containing 5 would count
as a second instance but A12 containing 7 and B12 containing 6 would not. Am
I making sense?
TIA
Sandy



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Sumproduct (I think?)

Put these values in C1:C6 - 3, 4, 5, 6, 7, 8, then in D1 enter this
formula:

=SUMPRODUCT((A$1:A$100=C1)*(B$1:B$100=C1-1))

then copy the formula down into D2:D6. It will give you the count of
the number of instances where A is one more than B, for the values of
A given in column C.

Hope this helps.

Pete

On Mar 30, 4:20 pm, "Sandy" wrote:
I have two ranges A1:A100, B1:B100 each containing single digit numbers
typically between 3 and 8. (No blank cells.
I would like to count all the instances of each time row B contains a number
one less than that in the equivalent A cell. eg if A5 contains 6 and B5
contains 5 then that would count as one instance. The pairs have to be the
same numbers. further eg A10 containing 6 and B10 containing 5 would count
as a second instance but A12 containing 7 and B12 containing 6 would not. Am
I making sense?
TIA
Sandy



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Sumproduct (I think?)

One way

=SUMPRODUCT(--(A1:A100-B1:B100=1),--(A1:A100=6))


Regards,

Peo Sjoblom


"Sandy" wrote in message
...
I have two ranges A1:A100, B1:B100 each containing single digit numbers
typically between 3 and 8. (No blank cells.
I would like to count all the instances of each time row B contains a
number one less than that in the equivalent A cell. eg if A5 contains 6
and B5 contains 5 then that would count as one instance. The pairs have to
be the same numbers. further eg A10 containing 6 and B10 containing 5
would count as a second instance but A12 containing 7 and B12 containing 6
would not. Am I making sense?
TIA
Sandy





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 270
Default Sumproduct (I think?)

Thank you thats perfect
Sandy
"Peo Sjoblom" wrote in message
...
One way

=SUMPRODUCT(--(A1:A100-B1:B100=1),--(A1:A100=6))


Regards,

Peo Sjoblom


"Sandy" wrote in message
...
I have two ranges A1:A100, B1:B100 each containing single digit numbers
typically between 3 and 8. (No blank cells.
I would like to count all the instances of each time row B contains a
number one less than that in the equivalent A cell. eg if A5 contains 6
and B5 contains 5 then that would count as one instance. The pairs have
to be the same numbers. further eg A10 containing 6 and B10 containing 5
would count as a second instance but A12 containing 7 and B12 containing
6 would not. Am I making sense?
TIA
Sandy





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
Sumproduct jaybird2307 Excel Worksheet Functions 2 July 7th 06 01:13 PM
Sumproduct T De Villiers Excel Worksheet Functions 2 October 4th 05 12:25 PM
Sumproduct? imjustme Excel Discussion (Misc queries) 1 September 7th 05 03:43 AM
SUMPRODUCT Help Sam via OfficeKB.com Excel Worksheet Functions 2 August 30th 05 02:24 AM
SUMPRODUCT Help Sam via OfficeKB.com Excel Worksheet Functions 2 August 29th 05 06:38 PM


All times are GMT +1. The time now is 08:03 AM.

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

About Us

"It's about Microsoft Excel"