Understand and fix a formula someone else wrote

You will be able to use an assistant to explain an inherited formula and find out why it gives the wrong answer.

Priya took over operations and inherited a delivery cost tracker from someone else, an invented example. A column of VLOOKUP formulas pulls each supplier's rate from a table on the right, and the sheet worked for two years. Last month every new supplier started showing #N/A, and the monthly cost total was quietly too low.

Most offices have an old, important spreadsheet like this, built by someone who has since moved to another department or company. An inherited formula is a formula in a spreadsheet built by someone else who is no longer around to explain it. It is hard to fix because you have to understand it first, and understanding it is where an AI assistant helps most.

Getting a plain explanation of the formula

Click the cell, copy the formula exactly from the formula bar, and paste it into the assistant. On its own the formula tells the assistant little, because it only sees cell references such as A2 or F2 to G150. Describe what each referenced column or range contains. In Priya's case, column A holds the supplier code, and columns F and G hold a table of supplier codes and their rates. Also say whether you use Excel or Google Sheets.

Ask for a step-by-step explanation in plain language, pitched at someone who has never used the function, followed by a one-sentence summary of what the whole formula is for.

Priya's formula used VLOOKUP, a function that finds a value in the first column of a range and returns the matching value from another column of that range. The assistant told her the formula took the supplier code in A2, looked for it in the first column of F2 to G150 and returned the rate from the second column. The final argument, FALSE, meant exact match only, so when there was no match the cell showed #N/A, the error a lookup gives when it finds nothing. She had used the sheet for months, and this was the first time she understood the formula.

Describing the problem and asking for causes

Typing "fix this formula" is tempting but gives a weak result. The assistant produces a new formula that may or may not address the real problem, and you learn nothing about why the old one failed.

Describe the wrong result and the result you expected as precisely as you can, including which cases work and which fail. Then ask for the most likely causes in order of likelihood, and how to check each one. Priya wrote that codes added since last month showed #N/A, that older suppliers still worked, and that she expected a rate for every supplier in the table.

A ranked list of causes with a check for each makes the assistant a diagnostic partner. It suggests where to look, and you stay in charge of finding out which cause is true.

Three common causes of broken inherited formulas

A few problems cause a large share of inherited formula failures. Knowing them before you ask helps you read the assistant's answer and decide where to look first.

The first is a range that does not cover new rows. A formula written when a table had 150 rows refers to rows 2 to 150, so rows added later, such as 151 to 180, are never seen by the formula. This was Priya's problem: her supplier table had grown to 180 rows and the new suppliers sat outside the range.

The second is numbers stored as text. A supplier code such as 1042 might be typed as a number in one place and imported as the text "1042" in another. The two look identical on screen but will not match. Numbers stored as text can also affect totals, because text that looks like a number is often left out of a sum without warning. To check, see whether values are aligned left or right in their cells, or use a function that tests whether a cell is a number.

The third is an absolute reference in the wrong place. An absolute reference has dollar signs, as in $F$2, which stop the spreadsheet shifting that reference when the formula is copied. You want this for a lookup table. If the dollar signs are on the wrong part, for example on the cell being looked up, every copied row uses the same lookup value and gives the same answer.

Testing one change at a time

Once you have a likely cause, make one change, then recheck. If problems remain, test the next cause with another single change and recheck again.

Priya first extended the range to cover the whole table and rechecked the new suppliers. Most now showed rates, but two still showed #N/A. She checked those two codes and found they had been imported as text, and converting them fixed the last two. Because she changed one thing at a time, she knew which fix mattered.

Changing several things at once may work, but you will not know which fix mattered, and the next time the sheet breaks you will be guessing again. One change at a time also stops you introducing a new error while fixing the old one.

Leaving a note for the next person

When the formula works, write down what it does where the next person will find it: a short note in the sheet next to the column, or a cell comment.

Pick a formula from a spreadsheet you use but did not build, ideally one that has puzzled you, and start by getting it explained.

Take a formula from a spreadsheet you use but did not build, get an explanation, and write a comment in the sheet saying what it does.

Course

Junxiong-WFG Organisation is an authorised representative of AIA Financial Advisers Private Limited (Reg. No. 201715016G).