Sum excluding some invalid data

Copper Contributor

Hi 

I need quick help.

I need to create a spreadsheet that will sum some values but I need to exclude some rolls as a requirement.

Can you help me with it?

This is an example (but in my case, is a lot of data)

ID'sDescriptionContent Value
1Test row 1Valid Content 10
2Test row 2Valid Content20
3Test row 3Invalid Content30
4Test row 4Valid Content40
5Test row 5Invalid Content50

... 

 

In this example, the only values that I want to sum are the valid ones and transform this sum into a percentage.

Thanks, guys!

 

 

3 Replies

@Tati_Guerzoni 

=SUMPRODUCT(NOT(ISNA(C2:C25))*D2:D25)

 

Maybe with this formula if the invalid content is an NA error.

 

=SUMPRODUCT(IF(ISERROR(C2:C25),0,1)*D2:D25)

 

Or maybe with this formula to exclude any error. Enter this formula as arrayformula with ctrl+shift+enter if you don't work with Office365 or 2021.

 

 

Hi Use sumif function, column C (content) and D (value) =SUMIF(C2:C6,"Valid Content",D2:D6)

@Jihad Al-Jarady 

Cosmetic comment. Since % is required, perhaps

=SUMIF(C2:C6,"Valid Content",D2:D6) / SUM(D2:D6)