1

I have spreadsheet: https://docs.google.com/spreadsheets/d/19GrXAFLpv6jz9OzDum-fyfP_m-RZFCNrQ0rr1vd5bYI/edit?usp=sharing

I want to count percent of wins(W) in C column and write it to C1 cell. I plan to add many rows.

I know VBA little bit, but not found how to use it inside Spreadsheet.

How to use VBA there?

And how to do this with fuction button?

migrated from superuser.com Jul 31 '15 at 12:38

This question came from our site for computer enthusiasts and power users.

  • It's not clear for me what you are asking. Regarding VBA in Google spreadsheets, check out Extend Google Docs, Sheets, and Forms with Apps Script - Docs editors Help – Rubén Jul 31 '15 at 23:19
  • I'm asking default way to count words "W" in column to receive answer 15 from 25 or 60%. As alternative I know VBA, and if somebody know how to use it there - it would help. As I can see in your link it`s JavaScript, thank you, at least something I can try. – Sergey Senkov Aug 6 '15 at 21:05
1

There is no need of something similar to VBA as the percentage could be calculate by using built-in functions.

The column C has values L or W. To calculate the percentage of W use the following formula in C1:

=COUNTIF(C3:C,"W")/COUNTA(C3:C)
  • COUNTIF(C3:C,"W") counts cells from C3 to the last cell in column C with W.
  • COUNTA(C3:C) counts all the cells from C3 to the last cell in column C with any alphabetic value.

To display the result as percentage apply the % format.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.