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.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
63,982
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
63,982
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))
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,130
Messages
5,857,550
Members
431,885
Latest member
Rsdg

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
Top