COUNTIF(range, criterion) counts the cells in a range that match. SUMIF(range, criterion, sum_range) checks one column and adds up the matching rows of another.
The criterion can be text in quotes, like "Open", a number, or a cell that holds the value you want. Text matching ignores upper and lower case. For a comparison, put the operator inside the quotes: ">4", "<>Closed". To compare with a cell, join the operator to it with &: ">"&G1.
In SUMIF, the first range is where Sheets looks for a match and the last range is what it adds. Both must be the same height so row 5 of one lines up with row 5 of the other.
When you put these in a summary table and fill them down, lock the data ranges with $ so only the criterion cell moves.