Excel IF函数公式报错#NAME? 求实现指定逻辑的正确写法
Hey there, let's fix that #NAME? error in your Excel formula right away! The issue comes from two syntax mistakes that Excel can't recognize.
Correct Formula for Your Requirement
=IF(SUM(E16:E20)>240, E21/0.3, E21)
Why You Got the #NAME? Error & Fixes
- Mistake 1: Invalid SUM Function Usage
You wrotesum=E16:E20which isn't how Excel's SUM function works. To calculate the total of E16 to E20, you need to use the proper function syntax:SUM(E16:E20). Thesum=part here is completely incorrect and confuses Excel, leading to the name error. - Mistake 2: Unnecessary
sum=Prefix
The part(sum=E21/0.3)also has an extrasum=that doesn't belong. The second argument of the IF function just needs the value you want to return when the condition is true—so justE21/0.3works perfectly.
How This Formula Works
This formula exactly matches your needs:
- First, it calculates the sum of cells E16 to E20 using
SUM(E16:E20) - If that sum is greater than 240, it returns the result of E21 divided by 0.3
- If the sum is 240 or less, it simply returns the value in E21
内容的提问来源于stack exchange,提问作者Renee Hanley
相关产品推荐
相关产品推荐

