Help with excel functions

Royce Fickling 20 Reputation points
2025-12-12T13:09:39.1533333+00:00

I have a score sheet in which I am calculating score averages. In some cases, a player didn't play any games, so his total would be zero. If so the formula C4/D4 will fail because division by 0 throws an error. (C4 is games won, D4 is total games played.) However, if D4 is not zero, the formula works and returns a value shown as a percentage.

I can't get the syntax correct for this computation. Can someone please help me with this?

Microsoft 365 and Office | Excel | For home | Android
0 comments No comments
{count} votes

Answer accepted by question author
  1. Q&A Assist
    2025-12-12T13:10:46.2533333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To handle the division by zero error in your Excel formula, you can use the IF function to check if the denominator (D4) is zero before performing the division. Here's how you can structure your formula:

    =IF(D4=0, 0, C4/D4)
    

    In this formula:

    • If D4 is zero, it will return 0 (or you can choose to return another value or message).
    • If D4 is not zero, it will perform the division C4/D4 and return the result.

    This way, you avoid the division by zero error and can still calculate the score averages correctly when applicable.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. IlirU 1,436 Reputation points Volunteer Moderator
    2025-12-12T13:24:33.07+00:00

    User's image

    Hi,

    Let suppose you have situation as shown in the screenshot. In this case use this single formula in cell D5:

    =AVERAGE(TOCOL(C2:C4 / D2:D4, 3))

    or in cell E2 apply this formula and drag it down:

    =IFERROR(C2 / D2, "")

    then in cell E5 use this formula:

    =AVERAGE(E2:E4)

    Hope this helps.

    IlirU

    0 comments No comments

  2. Ashish Mathur 100.8K Reputation points Volunteer Moderator
    2025-12-12T23:30:25.64+00:00

    Hi,

    In cell C6, enter this formula

    =AVERAGE(MAP(B2:B4,C2:C4,LAMBDA(a,b,IFERROR(a/b,""))))

    Hope this helps.

    User's image

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.