Formula Help

gillinglis

New Member
Joined
Oct 5, 2006
Messages
5
Need a YTD % total so add 4 amounts from 4 different sheets, then divide by the count. But some figures are 0 so don't want to include. Can't get Count or CountIf to do this. Any ideas?

Cheers.
 

Some videos you may like

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
54,940
Office Version
  1. 365
Platform
  1. Windows
You can exclude zeroes from your COUNT with something like:
=COUNTIF(A1:A4,"<>0")

Zeroes won't hurt the adding/summing part, as they are adding nothing to the total.
 

gillinglis

New Member
Joined
Oct 5, 2006
Messages
5
Still can't get it to work. Can you give me a sample formula? I have four cells on four separate sheets which I've added. This is the formula I used:
=('Sheet1'!M9+'Sheet 2'!M9+'Sheet3'!M9+'Sheet 4'!M9)

this gives me a total of 200.

I want to get a % total and 2 of the 4 figures in the count are 0's so I don't want them to be used.
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
54,940
Office Version
  1. 365
Platform
  1. Windows
You can use 4 separate COUNTIFs and add them, though that probably isn't the most efficient use of COUNTIF.

If you are looking at the same cell on every sheet, I believe I have seen some nifty formulas that account for that, though I can't seem to locate them right now.

In the meantime, this may not be the most efficient way, but it should work:
=('Sheet1'!M9+'Sheet 2'!M9+'Sheet3'!M9+'Sheet 4'!M9) /(('Sheet1'!M9<>0)+('Sheet2'!M9<>0)+('Sheet3'!M9<>0)+('Sheet4'!M9<>0))
 

Watch MrExcel Video

Forum statistics

Threads
1,114,676
Messages
5,549,373
Members
410,911
Latest member
AniEx
Top