R Squared Formula Based on Conditions

I am trying to insert the R squared formula as follows:

=RSQ(Known_ys, Known_xs) ONLY if row(i)= "YES" and ignore the rest of the data. For instance, the below should calculate RSQ excluding the rows where values in column C ="NO". I tried the following formula, but it didnt work: = {IF(C1:C4="YES",RSQ(B1:B4,A1:A4),"")}

A B C
6.2 3.79 YES
7.2 4.56 NO
8.8 6.22 YES
4.5 8.9 YES
1

1 Answer

♣SOLVED♣

Here you go (in relation to screenshot below):

=RSQ(IF($C$1:$C$4="YES",B1:B4,""),IF(C1:C4="YES",A1:A4,""))

Ta, J

3
Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article