# 7. Use Functions to Determine Total Budget by Category

## Transcript

You already know how to use simple formulas and functions to create and maintain your budget, as well as how formatting can show the overall trends in your data.

Next, you will learn more complex functions to address specific questions you may have about your budget.

In this video, you will use functions to find out how much money is being spent in a specific project category.

This will help you use the data in your spreadsheet to keep your project moving toward its specific goals.

Look at the budget you created.

A lot of red numbers is an indication that you may not have enough resources to complete your project as outlined.

But it’s difficult to know which project category is creating the problem.

To determine exactly where your project may have gone over budget, calculate the actual cost per category.

Add the heading By Category to the summary section of your spreadsheet.

Bold the heading.

List the categories you included in your spreadsheet.

Create a new column in E1, and label it Actual Cost Per Category.

Bold the heading,...

...and format the column for currency.

To find the actual cost per category, use a function.

Determine which function is best for your specific calculations by reviewing them in the Help menu.

In this example, you will use the function SUMIF to calculate the total spent for each category on your budget.

A SUMIF function includes 3 parts, each separated by a comma.

The first is the cell range that contains the category names.

In this case, you listed the categories in Column B, beginning with row 10.

Type B10:B to indicate this range.

Add a comma after the B.

The range highlights in your spreadsheet.

Next, add the cell reference by selecting the cell that contains the category name.

Then, type a comma.

Finally, add the sum range, or the range of cells with the values to be added.

In this case, the values are in Column D, starting with D10.

Type D10:D, and close the parentheses.

Be sure there are commas between each argument in your function.

Then, press Enter.

The spreadsheet adds all of the expenses for the category you chose, and the total appears in this cell.

Double click on the function cell.

Be sure the function references the appropriate cells or range.

Next, copy the function to other cells.

Drag the cell handle to extend the function to the rest of the categories.

Oh no!

The numbers don’t add up correctly for each category.

Typical cell references -- such as D2 or D10 -- are relative.

That means they change when a function is copied to another cell.

Because you changed the cell reference with the name of the category, the spreadsheet assumed that the other cells would also shift down.

To fix this, add an absolute cell reference to the formula.

Absolute references remain constant, even when you copy them to another cell or sheet.

Absolute references allow you to reference the same cell or range in multiple formulas.

In this case, the cell range and the sum range remain constant.

Add dollar signs to the formula in the cell range before the B and before the 10.

Then, add dollar signs to the sum range, before the D and before the 10.

Drag the cell handle to copy the formula to other categories.

The calculations are correct!

Nice job!

Now that you understand how to use complex functions in Google Sheets, you can apply this knowledge to other projects in the future.

Use the Help menu to search for the functions that make the most sense in your future calculations.

## Instructions

- Create a SUMIF function.
- Add absolute references to lock cell references.
- Copy the function to the other categories.
- Double-check your math.