Forum Discussion
DarbyNap
May 12, 2023Copper Contributor
Auto-Populate Data in Cells Based on Category Totals
I'm not great at Excel, so I bet there is an easy way to do this and I'm just not seeing it online anywhere or Googling the correct things! I track my marketing invoices for work in an Excel shee...
Karma21237
May 12, 2023Copper Contributor
Let me know if I understand your question. You want to find the total amount for each category: Advertising, Social Media, etc. What I would do is use the SUMIF() function. For this function, you would do:
SUMIF(Category Range, What you want to sum. So if you want it to sum Advertising amount you put "Advertising", Amount Range)
Category Range: represents the column that has all of your categories, I would just highlight the entire column: A,B,C,etc.
For the second portion, include the category you want to find the sum of AND PUT IT IN QUOTES.
Amount Range: Represents the column that has all of your Amounts, I would just highlight the entire column: A,B,C,etc.
DarbyNap
May 12, 2023Copper Contributor
Thanks a lot! I think that the SUMIF function might be the solution? But, I'd like to keep the invoices organized by date, which means that the range portion would be staggered. So, I might have three Social Media invoices, and then two Advertising invoices, and then another Social Media invoice. Does this roadblock make sense? I want to send a screen shot of my sheet, but I can't figure out how to do it! The upload image option here isn't as simple as just uploading an image. I hope my response makes sense.
- Karma21237May 12, 2023Copper ContributorSo you want to have everything sorted by the date is that correct? Sure! Click Home tab > arrow under Sort & Filter (3rd from most right), and then click Sort Oldest to Newest, or Sort Newest to Oldest.
Let me know if this helps!- DarbyNapMay 12, 2023Copper ContributorSorry, I don't think I'm explaining it correctly! 🙂 You're being very helpful but without being able to attach a screenshot I don't think I'm making great sense here. I know how to sort by date, but I don't understand the SUMIF function completely as it relates to me having to select a range. Let me try again! It might be as simple as me needing to set this up differently, but I don't see how.
Manually-Entered Data Columns
So, I have Columns A-G filled with data. The column headers include information about the date, the total amount of the invoice, the company, the necessary accounting information, and the billing code, (or category) among other things. Column A contains the date, and Column B contains the amount. Column G contains the billing code. I manually enter this information in the order it's received from the companies billing me, which means they're automatically in order by their date, with the newest at the bottom. That means that Column G, which contains the billing code, really varies quite a bit. There could be a billing code for Advertising that's the same 5 times in a row, because I have five invoices for Advertising that I received five times in a row. Then one day I'll get an invoice for Web Development, or Social Media, let's say. That billing code is different. So there will be five Advertising billing codes, followed with one Social Media billing code and then two Web Development billing codes. Then maybe two more Advertising invoices, followed by another Social Media billing code invoice, but there will never be a situation where there are a consistent set of billing codes not broken up by others. I hope that makes sense. Plus, information is always being added, so I would have to constantly re-select a range (if I understand the SUMIF function correctly, which I may not) every time I am adding a new invoice to the data columns.
Category Columns
Now, Columns J-M have four categories labeled on them as headers, which are the billing codes (one related to advertising, one social media for example, etc.). These are the columns I'd want to contain the auto-populated data. So under Column J, in the cell directly below the category label, I'd want to have Excel auto-populate the total amount of money we've spent on any of these categories, with the information being taken from the Manually-Entered Data Columns. It sounds like the SUMIF function makes sense here, but I'm not understanding how I'd use it if I have to select a range. I am constantly adding to this spreadsheet manually, and the column that contains the billing codes varies wildly. There are several different ranges of the same billing code. I have a total of 31 invoices I've entered since January 3, 2023 and expect to more than double this before the end of the year.
I'd like to see the total amount spent per category updated in real time, each time I add a new invoice. It is quite possible that this isn't a function I suppose, but I would be shocked if that's true!
It is also quite possible that your answer with SUMIF is correct! Am I not understanding the SUMIF function properly? I am not sure what the range I need to select is. This is what Excel prompts me to include when I type =SUMIF: (range, criteria, [sum_range]). I hope that my additional and more detailed information helps.
Thanks for assisting. 🙂- sanjibduttaMay 13, 2023Brass ContributorDarbyNap
To understand SUMIFS function better please look documentation at https://support.microsoft.com/en-us/office/sumifs-function-c9e748f5-7ea7-455d-9406-611cebce642b.
First convert your data ranges including column headers to table (Ctrl +T and then select data ranges including column headers and give the table a name e.g. "Invoice ). Then please try following formula (Assuming table name as "Invoice) in J2 if that's where the total value start from and then copy the formula (Drag) 4 columns to the right.
=SUMIFS(Invoice[Amount],Invoice[Category],LEFT(J1,IFERROR(FIND(" ",J1)-1,LEN(J1))))
Let me know if that works..Thanks