Formula Help

Chris_010101

Board Regular
Joined
Jul 24, 2017
Messages
188
Office Version
  1. 365
Platform
  1. Windows
Hello

Excel Formula:
=IF(OR(ISBLANK(B3)), "", SUM(B3)*NETWORKDAYS("01/01/2023", "31/12/2023", 'Lists (Hide)'!$D$2:$D$26)/2)

If I enter non-numerical value in column "B" where the above formula sums from, it returns "0".

1678267837665.png


I was planning to use IFERROR with the above formula to return a message if a non-numerical value is accidentally entered but can't because it's returning "0" instead of a #VALUE! (or another) error code (which I would have expected).

Kind Regards
Chris
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Can you not just put data validation on the cell to force user to enter a number?
 
Upvote 1
Solution
Hello

Excel Formula:
=IF(OR(ISBLANK(B3)), "", SUM(B3)*NETWORKDAYS("01/01/2023", "31/12/2023", 'Lists (Hide)'!$D$2:$D$26)/2)

If I enter non-numerical value in column "B" where the above formula sums from, it returns "0".

View attachment 87036

I was planning to use IFERROR with the above formula to return a message if a non-numerical value is accidentally entered but can't because it's returning "0" instead of a #VALUE! (or another) error code (which I would have expected).

Kind Regards
Chris
OR(ISBLANK(B3) is redundant. Only ISBLANK is needed. The sum of non numeric values is 0, so you end up with 0 * any number equals 0.
In the Formula tab, using the Evaluate Formula button would have shown that quickly.

You may want to consider using ISNUMBER instead of ISBLANK.
Excel Formula:
=IF( NOT(ISNUMBER(B3)), "", SUM(B3) * NETWORKDAYS("01/01/2023","31/12/2023",'Lists (Hide)'!$D$2:$D$26)/2))
That should work. My version is actually "=IF( NOT(ISNUMBER(B3)), "", SUM(B3) * NETWORKDAYS("01/01/2023","12/31/2023",Table1[Date]))", and I reworked it here to match yours.
 
Upvote 0
You may want to consider using ISNUMBER
Why? Surely ISTEXT would be better if you are looking for a text value

@Chris_010101 whilst I would agree that data validation is the best option, for the formula you could use
Excel Formula:
=IF(ISTEXT(B3),"Please enter a number",IF(B3="", "", SUM(B3)*NETWORKDAYS("01/01/2023", "31/12/2023", 'Lists (Hide)'!$D$2:$D$26)/2))
 
Upvote 0
Just realised that there is also a redundant SUM function in there, it should just be
Excel Formula:
=IF(ISTEXT(B3),"Please enter a number",IF(B3="", "", B3*NETWORKDAYS("01/01/2023", "31/12/2023", 'Lists (Hide)'!$D$2:$D$26)/2))
 
Upvote 0

Forum statistics

Threads
1,215,454
Messages
6,124,931
Members
449,195
Latest member
Stevenciu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top