Forum Discussion
Excel Calculated Fields
Hello All,
I wanted to know if there was a way to save calculated fields as a template within excel.
I analyze and download various reports that contain all the same field names. I create about 8 different calculated fields when analyzing the data set and I do this about a dozen times a day which is very time consuming.
Thanks for all the help.
- Mark FitzgeraldIron Contributor
Excel tables allow for automatic extension of formulas down wards to match the number of value rows.
A simple Excel table needs a single header row containing unique values followed by at least 1 row of input values and formulas referencing some of the input values on the same row. Headers can be nonsense like a series of numbers or letters if you can't discern meaningful labels for them.
Import some sample data then construct your formulas to the right of the data. The formulas should reference cell(s) on the same row using row-wise relative references (i.e. without a $ sign before the row number so you can drag the formulas down). Make sure your formulas are returning correct results. You can reference other formula cells on the same row too.
Press Ctrl + T to create and Excel table. Select all but the first row of your data/formula cells, right-click and Delete... Table rows. Clear the first row of imported data and tidy your formulas to suppress error display if necessary.
Save this as your template.
Import new data to your import area and formulas in the calculated area should extend down to match the import rows.
This should meet you need but I recommend you research Excel tables to explore structured referencing where you can replace cell references with named references which are easier to read.
- Deleted
Hello, Jin.
By 'calculated fields' I assume you're referring to columns containing formulas and that you want to save a template that is pre-populated with these formulas. And so, the short answer is; Yes.
Without more info about your system, data or formatting, I'll also assume your formulas use cell references (i.e. A1+B1) and not named ranges or fields in an Excel table.
So, I think the simplest approach would be to open an existing file (lets call it Report1) and simply select all of the cells containing you're data, right-click on the selection and choose 'Clear Contents' from the right-click menu. Clearing contents will not break cell references in formulas the way deleting the cells would.
Then save the file using Save As (or Save A Copy) with a different file name, e.g. Report1Template, so it is ready to use the next time you need to analyze Report1 by pasting the data from your source file into the empty cells in Report1Template.
Hope that helps.
- Jin SungCopper Contributor
Hello Robert,
Thank you so much for that tip.
I should have mentioned that these 'Calculated Fields' are used specifically in my pivot tables which as you know the "values' are formulated by the actual header names which are consistent every time I pull the data.
Is it possible to templatize this?
Thanks again! Much appreciated.