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.
-
Happy to help! 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 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!