Can I have blank fields treated as zero in functions
Hi,
I am trying to average a range of cells. Two questions:
- Most important - in some cases the cell is empty. That should be treated as a zero but the AVG function is ignoring the blanks and only taking the average of the populated cells.
- If there happens to be text in the field (there should not be), then the field can be ignored.
Thanks,
Suzanne
Best Answer
-
You could do a SUM divided by a COUNTIFS to specify exactly what should and should not count towards the average.
=SUM(range to sum)/COUNTIFS(range to sum, NOT(ISTEXT(@cell)))
The COUNTIFS portion will count every cell that is not text meaning it will count rows that have a number or a blank.
Answers
-
You could do a SUM divided by a COUNTIFS to specify exactly what should and should not count towards the average.
=SUM(range to sum)/COUNTIFS(range to sum, NOT(ISTEXT(@cell)))
The COUNTIFS portion will count every cell that is not text meaning it will count rows that have a number or a blank.
-
This is great, thanks so much Paul.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67.8K Get Help
- 474 Global Discussions
- 205 Use Cases
- 516 Announcements
- 5.5K Ideas & Feature Requests
- 87 Brandfolder
- 157 Just for fun
- 82 Community Job Board
- 521 Show & Tell
- 36 Member Spotlight
- 3 SmartStories
- 309 Events
- 37 Webinars
- 7.3K Forum Archives
Want to practice working with formulas directly in Smartsheet?
Check out the Formula Handbook template!
Check out the Formula Handbook template!