Icon

CountIf and SumIf

This workflow shows how to perform a SumIf and a CountIf function in KNIME Analytics Platform. Of course, there are different ways to get this done using KNIME. In the following example, we show you one of the possible ones.

CountIf and SumIf

This workflow filters data based on a condition and calculates the sum/count of values in another column similar to SUMIF and COUNTIF functions in Excel.

You can find more workflows and resources for spreadsheet users on the related collection page on the KNIME Community Hub.

Task

Calculate the total number of medals and appearances by female athletes in swimming disciplines in the Olympic Games between 1920 and 2020 by athlete and overall.

Read the data

  • Olympic_Athlete_Joined.xlsx containing information on athletes competing in the Olympic events

Filter the data

  • Female athletes in swimming disciplines

Calculate sum/count on the filtered data

  • The number of medals and appearances by athlete and overall

Append the count/sum values into two tables

  • Sum of medals and count of appearances by athlete

  • Sum of medals and count of appearances in total

Clean and export the data

  • Rename the count/sum columns

  • Sort the athletes by the number of appearances

  • Write the results into the original Excel file with a new sheet for both the overall and by athlete statistics

Combining SumIf and CountIf totals
Column Appender
Column Renamer
Reading athletes' information
Excel Reader
If logic matches, then filter rows
Rule-based Row Filter
Count athlete appearancesat Olympic Games
Row Aggregator
Duplicate Row Filter
Sum medals by each athtlete
Row Aggregator
Get rid of duplicate rows
Duplicate Row Filter
Missing Value
CSV Reader
String to Number
Column Renamer
Sorter
Appending total medals
Value Lookup
Column Renamer
Create a new filewith two new sheets
Excel Writer
Sorter

Nodes

Extensions

Links