-2

enter image description hereI am trying to calculate the ratio between two numbers when one is 0 .

Currently, this formula produces a blank cell, can anyone tweak it to allow it to calculate even if there is a 0 present?

This is the current formula :

=IF(COUNT(E9)=0,IFERROR(AVERAGE(C9),""),IFERROR(SUM(C9/E9),""))

Insider
  • 95
  • 12
  • 2
    Please note: `AVERAGE(C9)` is equivalent to `C9`. `SUM(C9/E9)` is equivalent to `C9/E9`. Don't use extra functions if you don't need to. – BigBen Feb 16 '21 at 17:22
  • Please provide sample data and the expected output. Division by `0` is undefined so you need to define the result you want. – BigBen Feb 16 '21 at 17:23
  • See edits, i want the w/l ratio to be calculated as 3.0 – Insider Feb 16 '21 at 17:31
  • 1
    `=C9/IF(E9=0,1,E9)`. I gave you this formula before, right? Why didn't it work? – BigBen Feb 16 '21 at 17:34

1 Answers1

3

Joining several comments into an answer:

  • You can use =C9/IF(E9=0,1,E9) to divide by 1 if E9 is equal to 0.
  • AVERAGE(C9) is equivalent to just C9; SUM(C9/E9) is equivalent to just C9/E9. It's best to avoid unnecessarily using extra functions.
BigBen
  • 46,229
  • 7
  • 24
  • 40