Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have two rows, and I want to add the total number of columns which have a 1
in them, over both rows. 1 0 0 1 1 0 1 1 0 0 1 1 So if a 1 occurs whether in one or both rows, it still counts as 1. So here the count would be 5. I cant get my head around it at all!!! Please help! |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
One way:
in the row below enter: A3: =--OR(A1,A2) and then copy across to F3, then you can just: =SUM(A3:F3) Hope this helps. Pete On Apr 10, 10:34 am, ceri_m wrote: I have two rows, and I want to add the total number of columns which have a 1 in them, over both rows. 1 0 0 1 1 0 1 1 0 0 1 1 So if a 1 occurs whether in one or both rows, it still counts as 1. So here the count would be 5. I can't get my head around it at all!!! Please help! |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I think this does what you want...
=SUMPRODUCT(--((A1:Z1+A2:Z2)0)) Rick "ceri_m" wrote in message ... I have two rows, and I want to add the total number of columns which have a 1 in them, over both rows. 1 0 0 1 1 0 1 1 0 0 1 1 So if a 1 occurs whether in one or both rows, it still counts as 1. So here the count would be 5. I cant get my head around it at all!!! Please help! |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks for you help guys - Rick's worked best for what I was after, Mike- for
soem reason it was giving me an answer of 0 with your formula, and Pete's it came with #value. But it's sorted now, so thank you all! :) "Rick Rothstein (MVP - VB)" wrote: I think this does what you want... =SUMPRODUCT(--((A1:Z1+A2:Z2)0)) Rick "ceri_m" wrote in message ... I have two rows, and I want to add the total number of columns which have a 1 in them, over both rows. 1 0 0 1 1 0 1 1 0 0 1 1 So if a 1 occurs whether in one or both rows, it still counts as 1. So here the count would be 5. I cant get my head around it at all!!! Please help! |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Try
=SUMPRODUCT((A3:F3=1)*(A4:F4=1)) With the ranges suitable adjusted. Mike "ceri_m" wrote: I have two rows, and I want to add the total number of columns which have a 1 in them, over both rows. 1 0 0 1 1 0 1 1 0 0 1 1 So if a 1 occurs whether in one or both rows, it still counts as 1. So here the count would be 5. I cant get my head around it at all!!! Please help! |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Well that's what you dont want!!
Try this instead =COUNTIF(A3:F3,"=1")+SUMPRODUCT((A4:F4=1)*(A3:F3< 1)) Mike "Mike H" wrote: Try =SUMPRODUCT((A3:F3=1)*(A4:F4=1)) With the ranges suitable adjusted. Mike "ceri_m" wrote: I have two rows, and I want to add the total number of columns which have a 1 in them, over both rows. 1 0 0 1 1 0 1 1 0 0 1 1 So if a 1 occurs whether in one or both rows, it still counts as 1. So here the count would be 5. I cant get my head around it at all!!! Please help! |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
If you do not want to use another row you could use this
=12-COUNTIF(A1:F2,1) where 12 is the total number of 0's and 1's in your example "ceri_m" wrote: I have two rows, and I want to add the total number of columns which have a 1 in them, over both rows. 1 0 0 1 1 0 1 1 0 0 1 1 So if a 1 occurs whether in one or both rows, it still counts as 1. So here the count would be 5. I cant get my head around it at all!!! Please help! |
#8
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Forget my post, it does not work
"ceri_m" wrote: I have two rows, and I want to add the total number of columns which have a 1 in them, over both rows. 1 0 0 1 1 0 1 1 0 0 1 1 So if a 1 occurs whether in one or both rows, it still counts as 1. So here the count would be 5. I cant get my head around it at all!!! Please help! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Paste Values in Number of rows as count in other sheet | Excel Discussion (Misc queries) | |||
Formula to count values in two columns | Excel Discussion (Misc queries) | |||
Count on multiple values with duplicate rows | Excel Worksheet Functions | |||
How to Count Rows with defined values in multiple columns | Excel Worksheet Functions | |||
Getting Count field to recognise rows with negative values in Exc. | Excel Worksheet Functions |