Spreadsheet formula copy/paste/edit
Sunday, April 12th, 2020 03:21 pmThis is based on LibreOffice Calc but probably works the same in Excel.
Say I have a column where several cells have formulas in them like:
=AVERAGE(C10:C18)
In the next column, I want to have the same formulas but using MIN instead of AVERAGE.
When I copy and paste the cells from the first column to the second, it changes the formulas like:
=AVERAGE(D10:D18)
To update the formulas in the 2nd column, select those cells and select from the menu, Edit - Find & Replace.
On the Find&Replace window, make sure these options are selected:
Current Selection Only
Search in: Formulas
Enter "AVERAGE" in the "Find:" field, and "MIN" in the "Replace:" field.
Click the Replace All button.
Then repeat that process to change all "D" to "C".
Alternately, this method should also work for keeping the original cell references when copying the formulas:
https://www.groovypost.com/news/microsoft-releases-windows-10-20h1-preview-build-18970/
First use Find&Replace to change all equal signs to a hashtag or other unique character.
Then copy/paste the cells to another column, and use Find&Replace to change the hashtag back to the equal sign again.
(This method could also be used for copying the formulas out of the spreadsheet into a text file, for easier editing.)
Say I have a column where several cells have formulas in them like:
=AVERAGE(C10:C18)
In the next column, I want to have the same formulas but using MIN instead of AVERAGE.
When I copy and paste the cells from the first column to the second, it changes the formulas like:
=AVERAGE(D10:D18)
To update the formulas in the 2nd column, select those cells and select from the menu, Edit - Find & Replace.
On the Find&Replace window, make sure these options are selected:
Current Selection Only
Search in: Formulas
Enter "AVERAGE" in the "Find:" field, and "MIN" in the "Replace:" field.
Click the Replace All button.
Then repeat that process to change all "D" to "C".
Alternately, this method should also work for keeping the original cell references when copying the formulas:
https://www.groovypost.com/news/microsoft-releases-windows-10-20h1-preview-build-18970/
First use Find&Replace to change all equal signs to a hashtag or other unique character.
Then copy/paste the cells to another column, and use Find&Replace to change the hashtag back to the equal sign again.
(This method could also be used for copying the formulas out of the spreadsheet into a text file, for easier editing.)