# "Marking" or "tagging" noncontiguous cells for later use in a formula

Is there is a way to 'mark' a cell (or a set of cells) throughout a worksheet or workbook in Google Sheets, such that I can perform operations on these easily later.

The real world application of this is that I have built a 2 year budget, but some costs are potentially not going to be incurred, and thus this budget becomes "free-able". I would like to be able to mark these cells in some way and then easily add up the total 'free-able' cash elsewhere.

The only way I could think to do this would be the colour the cells a particular colour, and then build some sort of IF/SUM that adds up a cell if it is coloured a particular hex value or similar, however from a bit of googling it appears that Sheets isn't capable of knowing what colour a cell is for use in a calculation. Almost a kind of 'inverse conditional formatting'?

If this approach doesn't work, there any other way of 'marking' these cells such that I can easily identify and add them later?

If the figures of interest are in the same column, insert a column next to the numbers and use a tag like `freeable cash` in that column by the figures of interest. You can then use `filter()` to pick up the values when necessary.

If the figure cells are not in the same column, you can get a list of their values by using a formula like this:

`=flatten(A2, A4, A5, B3, B6, Z4)`

The cell references in the list will automatically adjust as you insert or delete rows or cut and paste cells around, which makes it much easier to use than a textual list of cell locations.

The flattened list is easy to sum up, including summing it up to some max limit. The downside is that the process to "mark" a cell means that you will need to manually add it to the list in the `flatten()` formula, which takes a bit more effort than simply painting a cell with a color.

• Unfortunately not - as I mentioned these are quite 'disparate' cells, so they can be scattered throughout the sheet Nov 24 '21 at 15:06
• Edited the answer per OP's specific requirements. Nov 24 '21 at 16:19

Absolutely! The terminology used is 'naming' as opposed to 'marking'. Specifically 'naming ranges' or 'named ranges'.

A named range could be a single cell or multiple cells. It is an alternative to using the normal cell references you see in formulas and is very powerful tool.

Here is a Google Support article that may be of assistance: