can someone please tell me what i did wrong with this if statement?

  • Thread starter Thread starter unclescrooge
  • Start date Start date
U

unclescrooge

hi,

this is for keeping baseball stats. i basically want to insert into
the spreadsheet to calculate ERA if the player's position (C3) = P
(for pitcher) otherwise insert a zero.

=IF(C3=P,O3*9/P3,0)

O3 = number of earned runs
P3 = number of innings pitched

i did something similar to calculate batting average,

=IF(D2=0,0,E2/D2)

where D2= at bats
E2= hits

and that one seems to work just fine.
 
hi,

this is for keeping baseball stats. i basically want to insert into
the spreadsheet to calculate ERA if the player's position (C3) = P
(for pitcher) otherwise insert a zero.

=IF(C3=P,O3*9/P3,0)

O3 = number of earned runs
P3 = number of innings pitched

i did something similar to calculate batting average,

=IF(D2=0,0,E2/D2)

where D2= at bats
E2= hits

and that one seems to work just fine.

You have to tell excel, that "P" is a string:

=IF(C3="P",o3*9/P3,0)

hth

Carlo
 
You have to tell excel, that "P" is a string:

=IF(C3="P",o3*9/P3,0)

hth

Carlo- Hide quoted text -

- Show quoted text -

ah that explains it. i didn't think of that. thank you
 
Back
Top