Spreadsheets that do arbitrary cell tags?
September 2, 2007 10:24 AM
Subscribe
Ignorant spreadsheet question: do most (or any) spreadsheets have the ability to tag cells with an arbitrary name or label and then do operations on only the cells with that tag?
I want to write a formula that pulls its data from cells in a range that is not just discontinuous but what you might call shotgun-discontinuous; and to be able to append cells to or remove them from this shotgun-discontinuous range easily. Simple example: say I have a list of purchases for the year, with amounts, arranged sequentially by date from Jan 1 to Dec 30. Some of those purchases were related to, oh, a goat. Whenever I enter a new purchase for goat feed, goat clothing, goat education, goat cosmetics, goat vasectomy, etc. I'd like to tag the amount as "goat" and at the end of the month or year just do =sum(goat). Can I do that?
I'm aware or Excel named cells but it looks as if I can't have more than one cell named "goat" in a given spreadsheet, so that's not the answer. I guess I could also enter the text string "goat" in the cell beside any pertaining-to-goat amount and when write an IF-formula (IF cell next to amount contains string "goat" THEN add amount to running total). But is there a cleaner way to do this? I really do hope to achieve the concision of =sum(goat). Possible? Thanks ever so!
posted by jfuller to computers & internet (8 comments total)
3 users marked this as a favorite
I had one list consisting of line entries in the form of date/desc/cat/amt, and a second list for category subtotals in the form of cat name/subtotal. The "subtotal" cells were where the magic happened, and took the form
=SUMIF(FirstAmountCell:LastAmountCell,CatNameCell,FirstCatCell:LastCatCell)
In my case, it looked like this:
=SUMIF($D$5:$D$200,$G4,$E$5:$E$200).
There's probably an even more elegant way to do it, but this worked for me.
I can send you a copy of my budget worksheet, if you want. Hit me up by e-mail.
posted by adamrice at 11:12 AM on September 2, 2007