__Objective__

To apply the **SumIf** function in MS Excel.

__Approach__

If you look at the image below then you can see that in column A, we have mentioned “City”, and in column B we have mentioned “Count”. Our aim is to find the sum of “Count” field values for “New York City”. You can see in the image below that “New York City” has been listed twice.

We have applied the formula in cell E3 which is mentioned below –

** =SUMIF(A$2:A$6,”New York City”,B$2:B$6)**

Here A2:A6 is the criteria range, which means it is the column in which data for criteria exist. Here name of cities is given, which is because we want to find the sum of counts for a specific city. Next value in formula is “New York City”, it signifies that we want the sum of count column for “New York City”. In the last column we have B2:B6, which shows the range in which numeric values exists, here “Count” is the column for which we want the SumIf formula to work.

You can see the value highlighted as “700” in cell E3 in the image shown above, it is the sum of 100+600 for New York City, in the data shown in image.

Here “$” sign is used to fix the range, which means when you drag the formula down, it does not change the renage.

**Cheers!!**