简体   繁体   中英

Excel: How to make cell blank if formula returns an error or a number less than 0 or greater than 1?

I am working on an Excel spreadsheet and want to make my formulas return a blank cell if the formula returns an error, a number less than 0, or a number greater than 1. I cannot get my head wrapped around how to construct this IF statement. Here is my current formula:

P9=IF(AVERAGE(C9:O9)<0.001,"",AVERAGE(C9:O9)-1)/4

Q9=IF(B9<1,"",(B9-1)*P9/4)

you need to use the iferror function: https://exceljet.net/excel-functions/excel-iferror-function

basically

iferror(if(check for zero or one,"",somethingElse),"")

slightly easier to read maybe

A = a statement checking if something is zero or one
B = a placeholder value
C = blank = "" or something similar

iferror(if(A,B,C),C)

在这里试试这个:

=IFERROR(IF(OR(ISERROR(Q9),AND(B9>1,B9<5),AND(AVERAGE(C9:O9)>1,AVERAGE(C9:O9)<5)),"",(B9-1)*P9/4),"")

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