excel=IFD42=1RAND650-700RAND320-650
The formula you provided has a syntax error. Here is the corrected formula:
=IF(D42>=1,RAND()(700-650)+650,RAND()*(650-320)+320)
Explanation of the formula:
-
IF(D4*2>=1,...,...): This checks if the value in cell D4 multiplied by 2 is greater than or equal to 1. If it is true, then the formula returns the value after the comma (",") before the first semicolon (";"), otherwise it returns the value after the semicolon.
-
RAND(): This function generates a random decimal number between 0 and 1.
-
*(700-650)+650: This part of the formula calculates a random number between 650 and 700.
-
*(650-320)+320: This part of the formula calculates a random number between 320 and 650.
So, the final formula generates a random number between 650 and 700 if D4*2 is greater than or equal to 1, otherwise it generates a random number between 320 and 650.
原文地址: http://www.cveoy.top/t/topic/biw7 著作权归作者所有。请勿转载和采集!