G Guest May 17, 2005 #1 How do I say If the sum of A1:E1 is greater than 1, enter a 1 in the column, but if not then enter a 0?
How do I say If the sum of A1:E1 is greater than 1, enter a 1 in the column, but if not then enter a 0?
J JE McGimpsey May 17, 2005 #2 One way: =IF(SUM(A1:E1)>1,1,0) or, more compactly (using the fact that XL coerces TRUE/FALSE to 1/0 in math operations): =--(SUM(A1:E1)>1) where the first - coerces TRUE/FALSE to -1/0, and the second back to 1/0.
One way: =IF(SUM(A1:E1)>1,1,0) or, more compactly (using the fact that XL coerces TRUE/FALSE to 1/0 in math operations): =--(SUM(A1:E1)>1) where the first - coerces TRUE/FALSE to -1/0, and the second back to 1/0.
G Guest May 18, 2005 #5 Sorry, I still can't make it work - I want to add all the SS and LS together, and if they are more than one, have a 1 appear, and if the answer is 0 then a 0 appear? Thanks for all your help
Sorry, I still can't make it work - I want to add all the SS and LS together, and if they are more than one, have a 1 appear, and if the answer is 0 then a 0 appear? Thanks for all your help
J JE McGimpsey May 18, 2005 #6 One way: =IF(SUM(COUNTIF(A1:E1,{"SS","LS"})) > 0, 1, 0) or more compactly: =--(SUM(COUNTIF(A1:E1,{"SS","LS"})) > 0)
One way: =IF(SUM(COUNTIF(A1:E1,{"SS","LS"})) > 0, 1, 0) or more compactly: =--(SUM(COUNTIF(A1:E1,{"SS","LS"})) > 0)