Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How to auto count data in an empty cell to be 0. Blank cell=0

I would like empty cell to automatically set value 0.
For example. sum of largest two values in a row with
2, empty, empty, empty
I want the answer to be just 2 as it would if the data was
2,0,0,0
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How to auto count data in an empty cell to be 0. Blank cell=0

Excel treats empty cells as 0.

So maybe you could use:
=SUM(LARGE(A1:D1,{1,2}))




Jagneel wrote:

I would like empty cell to automatically set value 0.
For example. sum of largest two values in a row with
2, empty, empty, empty
I want the answer to be just 2 as it would if the data was
2,0,0,0


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How to auto count data in an empty cell to be 0. Blank cell=0

Dave

I tried this but if three of the cells are blank I get the #NUM! error.

I don't believe Excel is treating the blanks as 0 in this case.


Gord

On Wed, 13 Dec 2006 11:28:18 -0600, Dave Peterson
wrote:

Excel treats empty cells as 0.

So maybe you could use:
=SUM(LARGE(A1:D1,{1,2}))




Jagneel wrote:

I would like empty cell to automatically set value 0.
For example. sum of largest two values in a row with
2, empty, empty, empty
I want the answer to be just 2 as it would if the data was
2,0,0,0


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How to auto count data in an empty cell to be 0. Blank cell=0

Oops. Bad testing on my part!

How about this array formula:

=SUM(LARGE(IF(A1:D1="",0,A1:D1),{1,2}))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Gord Dibben wrote:

Dave

I tried this but if three of the cells are blank I get the #NUM! error.

I don't believe Excel is treating the blanks as 0 in this case.

Gord

On Wed, 13 Dec 2006 11:28:18 -0600, Dave Peterson
wrote:

Excel treats empty cells as 0.

So maybe you could use:
=SUM(LARGE(A1:D1,{1,2}))




Jagneel wrote:

I would like empty cell to automatically set value 0.
For example. sum of largest two values in a row with
2, empty, empty, empty
I want the answer to be just 2 as it would if the data was
2,0,0,0


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How to auto count data in an empty cell to be 0. Blank cell=0

Or

=SUM(LARGE(0+A1:D1,{1,2}))

still an array formula.

Gord Dibben wrote:

Dave

I tried this but if three of the cells are blank I get the #NUM! error.

I don't believe Excel is treating the blanks as 0 in this case.

Gord

On Wed, 13 Dec 2006 11:28:18 -0600, Dave Peterson
wrote:

Excel treats empty cells as 0.

So maybe you could use:
=SUM(LARGE(A1:D1,{1,2}))




Jagneel wrote:

I would like empty cell to automatically set value 0.
For example. sum of largest two values in a row with
2, empty, empty, empty
I want the answer to be just 2 as it would if the data was
2,0,0,0


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How to auto count data in an empty cell to be 0. Blank cell=0

even better (not an array formula):

=MAX(A1:D1)+IF(COUNT(A1:D1)<2,0,LARGE(A1:D1,2))



Gord Dibben wrote:

Dave

I tried this but if three of the cells are blank I get the #NUM! error.

I don't believe Excel is treating the blanks as 0 in this case.

Gord

On Wed, 13 Dec 2006 11:28:18 -0600, Dave Peterson
wrote:

Excel treats empty cells as 0.

So maybe you could use:
=SUM(LARGE(A1:D1,{1,2}))




Jagneel wrote:

I would like empty cell to automatically set value 0.
For example. sum of largest two values in a row with
2, empty, empty, empty
I want the answer to be just 2 as it would if the data was
2,0,0,0


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Only Empty Cells AFTER Cells with Data David Excel Worksheet Functions 2 September 15th 06 06:05 PM
why a reference to an empty cell is not considered empty Nicoscot Excel Discussion (Misc queries) 10 March 10th 06 05:36 AM
Blank (empty) cell always equal to 0?? ulfah Excel Discussion (Misc queries) 3 February 1st 06 04:55 PM
How do I leave formula cell blank if 2nd reference cell is empty? Liana S Excel Discussion (Misc queries) 2 October 21st 05 04:38 PM
Custom format that shows blank cell if another cell is empty Zdenek Moravec Excel Discussion (Misc queries) 1 March 25th 05 11:45 AM


All times are GMT +1. The time now is 02:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"