简体   繁体   中英

Data table calculation error referencing a cell with text field

I am working on a model with several thousand rows of data, and several blank fields. I am having trouble with the following two calculations in a data table.

  1. BMI = IFERROR(([@Weight]/[@Height]^2)*704,"")
  2. Obese = IF([@BMI]>=30,1,0)

I must be doing something wrong, as the results of the second calculation are incorrect.

  • For each cell where BMI = "", the Obese calculation is returning a "1", not a "0".

I am not sure why this is the case nor how to fix it.

Note: I also tried the following formula: BMI = IFERROR(([@Weight]/[@Height]^2)*704,) . All cells where there was an error as 0 . This works for calculating the Obese statement, but causes other problems as the "0" value messes up my average calculations.

Excel does return TRUE when comparing a string to a number like this ( why Excel does this a can't say)

The fix is to test for a number in the OBESE formula

 = IF(AND(ISNUMBER([@BMI]),[@BMI]>=30),1,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