Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default count and return pair numbers

What is your definition for pair and impair numbers?

"Sly" wrote:

What function can I use to return the number of pair or impair numbers in a
row

A B C D E F

Row 1 2 6 9 11 16 20 Pair number = 4
Impair number = 2

Thanks

Sly

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sly Sly is offline
external usenet poster
 
Posts: 11
Default count and return pair numbers

sorry

odd numbers = 2

Even numbers = 4



"bj" wrote:

What is your definition for pair and impair numbers?

"Sly" wrote:

What function can I use to return the number of pair or impair numbers in a
row

A B C D E F

Row 1 2 6 9 11 16 20 Pair number = 4
Impair number = 2

Thanks

Sly

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default count and return pair numbers

Try these formulas...

Odd: =SUMPRODUCT(--(MOD(A1:F1,2)=1))

Even: =SUMPRODUCT(--(MOD(A1:F1,2)=0))

Rick


"Sly" wrote in message
...
sorry

odd numbers = 2

Even numbers = 4



"bj" wrote:

What is your definition for pair and impair numbers?

"Sly" wrote:

What function can I use to return the number of pair or impair numbers
in a
row

A B C D E F

Row 1 2 6 9 11 16 20 Pair number = 4
Impair number = 2

Thanks

Sly


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default count and return pair numbers

Try these formulas...

Odd: =SUMPRODUCT(--(MOD(A1:F1,2)=1))

Even: =SUMPRODUCT(--(MOD(A1:F1,2)=0))


Mike raises a good point about blanks. Here are revisions to the above which
will account for the blanks...

Odd: =SUMPRODUCT((A1:F1<"")*(MOD(A1:F1,2)=1))

Even: =SUMPRODUCT((A1:F1<"")*(MOD(A1:F1,2)=0))

Rick

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default count and return pair numbers

Rick,

Odd: =SUMPRODUCT(--(MOD(A1:F1,2)=1))


You don't need the =1, (--(MOD(A1:F1,2) returns 0 or 1 anyway

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Rick Rothstein (MVP - VB)" wrote in
message ...
Try these formulas...

Odd: =SUMPRODUCT(--(MOD(A1:F1,2)=1))

Even: =SUMPRODUCT(--(MOD(A1:F1,2)=0))

Rick


"Sly" wrote in message
...
sorry

odd numbers = 2

Even numbers = 4



"bj" wrote:

What is your definition for pair and impair numbers?

"Sly" wrote:

What function can I use to return the number of pair or impair
numbers in a
row

A B C D E F

Row 1 2 6 9 11 16 20 Pair number = 4
Impair number = 2

Thanks

Sly







  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default count and return pair numbers

Good point! Thanks for noting that.

Rick


"Sandy Mann" wrote in message
...
Rick,

Odd: =SUMPRODUCT(--(MOD(A1:F1,2)=1))


You don't need the =1, (--(MOD(A1:F1,2) returns 0 or 1 anyway

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Rick Rothstein (MVP - VB)" wrote in
message ...
Try these formulas...

Odd: =SUMPRODUCT(--(MOD(A1:F1,2)=1))

Even: =SUMPRODUCT(--(MOD(A1:F1,2)=0))

Rick


"Sly" wrote in message
...
sorry

odd numbers = 2

Even numbers = 4



"bj" wrote:

What is your definition for pair and impair numbers?

"Sly" wrote:

What function can I use to return the number of pair or impair
numbers in a
row

A B C D E F

Row 1 2 6 9 11 16 20 Pair number = 4
Impair number = 2

Thanks

Sly






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
Count Intervals of 2 Consecutive Values in same Row and Return Count across Row Sam via OfficeKB.com Excel Worksheet Functions 6 November 29th 05 03:27 PM
Count Intervals of 1 Numeric value in a Row and Return Count down Column Sam via OfficeKB.com Excel Worksheet Functions 8 October 4th 05 04:37 PM
Count Intervals of 2 Numeric values in same Row and Return Count across Row Sam via OfficeKB.com Excel Worksheet Functions 12 September 24th 05 10:58 PM
Count Intervals of Filtered TEXT values in Column and Return Count across a Row Sam via OfficeKB.com Excel Worksheet Functions 9 July 31st 05 03:37 AM
in excel, how do I find which value doesn't have a pair? curiousjackie Excel Discussion (Misc queries) 3 December 17th 04 05:43 PM


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