简体   繁体   中英

How do I evaluate a formula in Google Sheets?

I'm trying to see where the math is going wrong in a formula, but I can't find a way to see what the formula is doing step by step. In Excel, you can search in the help bar for a tool called 'evaluate formula' which does exactly the job I need but I cannot find a similar formula in Google Sheets

Is there a way to evaluate a formula that is stored in a cell? Immediately appears on a google search however this talks about taking a string in 1 cell and using it as a formula in another cell, which is not what I'm looking for. I think in the 6 years since that post the phrase 'evaluate' has changed in meaning slightly.

=(IFERROR((vlookup($E9,$A$3:$Y$102,21,FALSE)*$J9),0))+(IFERROR((vlookup($F9,$A$3:$Y$102,21,FALSE)*$K9),0))+(IFERROR((vlookup($G9,$A$3:$Y$102,21,FALSE)*$L9),0))+(IFERROR((vlookup($H9,$A$3:$Y$102,21,FALSE)*$M9),0))+(IFERROR((vlookup($I9,$A$3:$Y$102,21,FALSE)*$N9),0))    

Easier to read if I put it like this:

 =(IFERROR((vlookup($E9,$A$3:$Y$102,21,FALSE)*$J9),0))+
(IFERROR((vlookup($F9,$A$3:$Y$102,21,FALSE)*$K9),0))+
(IFERROR((vlookup($G9,$A$3:$Y$102,21,FALSE)*$L9),0))+
(IFERROR((vlookup($H9,$A$3:$Y$102,21,FALSE)*$M9),0))+
(IFERROR((vlookup($I9,$A$3:$Y$102,21,FALSE)*$N9),0))    

I'd like to see what each vlookup is returning individually. I have over 500 cells with V similar cells so making a cell for each vlookup , then referencing those cells so it's easier to track the results isn't practical.

I expect the output of this cell, C9, to be less than B9 and more than D9 (B9>C9>D9 ect) however I am seeing inconsistent results where sometimes this rule is followed and sometimes it is not in my spreadsheet.

well, the most obvious way is to run them separately like:

=IFERROR((VLOOKUP($E9, $A$3:$Y$102, 21, 0)*$J9), 0)

or in an array:

={IFERROR((VLOOKUP($E9, $A$3:$Y$102, 21, 0)*$J9), 0),
  IFERROR((VLOOKUP($F9, $A$3:$Y$102, 21, 0)*$K9), 0),
  IFERROR((VLOOKUP($G9, $A$3:$Y$102, 21, 0)*$L9), 0),
  IFERROR((VLOOKUP($H9, $A$3:$Y$102, 21, 0)*$M9), 0),
  IFERROR((VLOOKUP($I9, $A$3:$Y$102, 21, 0)*$N9), 0)}  

or column instead of row:

={IFERROR((VLOOKUP($E9, $A$3:$Y$102, 21, 0)*$J9), 0);
  IFERROR((VLOOKUP($F9, $A$3:$Y$102, 21, 0)*$K9), 0);
  IFERROR((VLOOKUP($G9, $A$3:$Y$102, 21, 0)*$L9), 0);
  IFERROR((VLOOKUP($H9, $A$3:$Y$102, 21, 0)*$M9), 0);
  IFERROR((VLOOKUP($I9, $A$3:$Y$102, 21, 0)*$N9), 0)}  

or in one cell perhaps:

=IFERROR((VLOOKUP($E9, $A$3:$Y$102, 21, 0)*$J9), 0)&" "&
 IFERROR((VLOOKUP($F9, $A$3:$Y$102, 21, 0)*$K9), 0)&" "&
 IFERROR((VLOOKUP($G9, $A$3:$Y$102, 21, 0)*$L9), 0)&" "&
 IFERROR((VLOOKUP($H9, $A$3:$Y$102, 21, 0)*$M9), 0)&" "&
 IFERROR((VLOOKUP($I9, $A$3:$Y$102, 21, 0)*$N9), 0)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM