ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Only do Sum function if not "0", IF"0" then return "0" (https://www.excelbanter.com/excel-worksheet-functions/28642-only-do-sum-function-if-not-%220%22-if%220%22-then-return-%220%22.html)

Mike Punko

Only do Sum function if not "0", IF"0" then return "0"
 
Trying to build function that would do a count of days since last injury.
I'm having trouble getting it to count correctly. right now values are 1 or
0, 0 if there was an injury.

problem chart What I would like
1 = 1 1 = 1
0 = 1 0 = 0
1 = 2 1 = 1
1 = 3 1 = 2
1 = 4 1 = 3
0 = 4 0 = 0
1 = 5 1 = 1

Ron Coderre

Hmm...my response from a little while ago seems to have evaporated.
I'll try again:

If B1: Calc then
put this formula in B2 and copy down:
=A2*SUM(B1,A2)

Is that what you're looking for?
--
Regards,
Ron




All times are GMT +1. The time now is 03:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com