Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9831

How to get the average percentage of a column with condition from text data

$
0
0

I start with text data from a Google Sheet like this:

   A        B     1  Subject1 Text1 2  Subject2 Text2 3  Subject1 Text3 4  Subject1 Text3 5  Subject1 Text2 

What I want is to get the average in percent form of column B but only for Subject1 rows.

The text can be translated in numbers like this:

  • Text1 = 0
  • Text2 = 0.5
  • Text3 = 1

The formula or script can be summarized like this:

(Text1=0;Text3=1;Text3=1;Text2=0.5) AND (AVERAGE of B column but only for Subject1 rows in A column) = 0.625 AND (to PERCENT)

Finally, I get the end result: 63%

I tried several formulas and Apps Script but got errors and don't know enough JavaScript. Do you know how to get this end result?


Viewing all articles
Browse latest Browse all 9831

Latest Images

Trending Articles



Latest Images