Forum Discussion
remove a ' to convert a comment to a formula in excel
- Jan 20, 2020
Hi lsmithop Select the range of cells and use Text to Columns on the Data tab. Select nothing in the wizard, just click Finish and it should convert them back to formulas.
mathetes--
OK, here's your answer, if you care enough to follow my clumsy explanation.
I have a "master" worksheet which has about 70 columns -- raw data, formulas, derived data, etc. It's too wide (and too much detail) to print for our users. So I made a second worksheet, which uses "stacked" columns (3 lines of report info/club member) to provide all important info on each member:
Member Name Address Phones Emails
John Smith 123 Main St. H: 123-456-7890 John@home.com
Anytown, MD 11111 W: 123-543-2109 John@work.com
C: 234-555-1212 John@ourclub.org
Each of those reporting cells (in worksheet 2) refers to a cell in a different column but the same row (that member's row) in the master data worksheet (#1). But when I copy the above 3-line report block in worksheet 2, to make additional report blocks, the member row references get incremented incorrectly (to N+4, instead of N+1). So the "solution" I hit upon (using the tools I know) was to put a ' in front of all the = in the report block. and change the row numbers to ^^ (thus turning off the row reference increments altogether). Then I copied my commented report block 9 times, changed the ^^ to **1, ^^2, ^^3, ..., and ^^0 in the ten blocks that I had. Then I duplicated those ten blocks ten times (I needed 110 rows in the report), and then I selected successive blocks of 10 rows, and changed the ^^ to null, 1, 3, 3, and up to 10. Thus, 20 edits corrected 100 rows. Since each block contained 15 cell references, and I had 110 blocks, I now had 1650 correct cell references, but I couldn't remove the bleeping ' until Alan shared his amazing knowledge.
I am sure there is a better way to have done this, but just like "the best camera is the one you have with you", my rule is "the best solution is the one you know how to do" (including know to ask the Excel forum community when you hit a brick wall!).
Thanks to all of you!
Len
P.S. And yes, a named cell range is WAY better than a text constant!! Thanks...
On the one hand I could agree with such approach - it's always better to use what you know better. On the other hand, taking into account that manual transformations are always source of errors an usually time consuming, it could be worth to invest some time for the automation of routine operations.
I believe people here could suggest several variants (everything in Excel could be done by several ways) of such automation, from Power Query to different variants of formulas.
For example, far from optimal but relatively simple is variant with offset(), here you may just drag F1:G1 down
I have no intention to ask you for shifting on another method, that's only to illustrate that relatively simple but more reliable solutions usually exist.
- lsmithopJan 21, 2020Copper Contributor
Sergei - Wow, thanks for a great tip. I have used H/VLookup (which look sort of similar) for years, but have never even looked at offset(). Will test it tomorrow -- it looks better (and potentially more maintainable) than my approach. Thanks again!
- SergeiBaklanJan 21, 2020Diamond Contributor
lsmithop , please note I gave only mockup, such formulas depends on actual data structure.