countif

iainsteel

New Member
Joined
Nov 29, 2007
Messages
31
Hi
I trying to add up positive cells in excel with countif except that the cells in question are not in a range.
So normally
=COUNTIF(L20:L30,">0")
But the cells i wish to count are 3 cells apart so I thought
=COUNTIF(L20,P20,T20,X20">0")
would work , but it doesnt.
Can anyone help?
Thank you
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Try:
Code:
=SUM(COUNTIF(INDIRECT({"L20","P20","T20", "X20"}),">0"))
 
Upvote 0
Try:
Code:
=SUM(COUNTIF(INDIRECT({"L20","P20","T20", "X20"}),">0"))

I forgot you could do that and only used a similar formula yesterday :oops: although personally I would go with

=SUM(COUNTIF(INDIRECT({"RC12","RC16","RC20","RC24"},0),">0"))

instead, that is assuming the formula is going in row 20.
 
Upvote 0
I forgot you could do that and only used a similar formula yesterday :oops: although personally I would go with

=SUM(COUNTIF(INDIRECT({"RC12","RC16","RC20","RC24"},0),">0"))

instead, that is assuming the formula is going in row 20.
True but as user, I prefer to use A1 than R1C1 ;)

At the end of the day it's just about personal preferences!
 
Upvote 0
you can use this version, especially for larger ranges

=SUMPRODUCT((MOD(COLUMN(L20:X20)-COLUMN(L20),4)=0)*(L20:X20>0))
 
Upvote 0
True but as user, I prefer to use A1 than R1C1 ;)

At the end of the day it's just about personal preferences!

And practicality, I avoid R1C1 whenever possible, but it's the only way to make an INDIRECT reference relative.:biggrin:
 
Upvote 0

Forum statistics

Threads
1,224,612
Messages
6,179,890
Members
452,948
Latest member
Dupuhini

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
Back
Top