Conditional SUM with SUMIF
If you want to add up cells based on a criteria, you can use the SUMIF function. For example, the formula =SUMIF(D5:D9, “Electronics”, F5:F9) sums only the values in column D where the corresponding cells in column F contain the text “Electronics”.
You can use any operators in the criteria argument, such as “*” for wildcard matching and “=” or “<>” for exact comparisons.
SUMIF is a great way to add up cells based on criteria, but it has one major limitation: it can only operate on one range at a time. Check the SUMIFS function if you want to SUM based on multiple criteria.