Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default can someone please tell me what i did wrong with this if statement?

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 367
Default can someone please tell me what i did wrong with this if statement?

On Nov 12, 2:11 pm, unclescrooge wrote:
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default can someone please tell me what i did wrong with this if statement?

On Nov 11, 11:25 pm, carlo wrote:
On Nov 12, 2:11 pm, unclescrooge wrote:





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- Hide quoted text -

- Show quoted text -


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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's wrong with this if statement? Karen Excel Discussion (Misc queries) 5 July 19th 08 04:54 PM
IF Statement help please - again - got it wrong last time! Alan Davies Excel Worksheet Functions 2 May 12th 06 12:28 PM
If Then statement in macro gone wrong ellmcg Excel Programming 2 May 3rd 06 04:16 AM
wts wrong with this statement Jason Excel Worksheet Functions 2 February 24th 06 02:26 PM
What is wrong with this IF statement? need help. AC man Excel Discussion (Misc queries) 4 January 11th 06 03:29 PM


All times are GMT +1. The time now is 03:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"