# Can This Be Done..?

1. ## Can This Be Done..?

Hi, Just wanted to know if the formula below can be shortened? I need to do it 3 more times for 3 or 4 more rows... Thanks for any help on this.

=COUNTIF(G18,">""")+COUNTIF(L18,">""")+COUNTIF(Q18,">""")+COUNTIF(V18,">""")+COUNTIF(AA18,">""")+COUNTIF(AF18,">""")+COUNTIF(AK18,">""")+COUNTIF(AP18,">""")+COUNTIF(AU18,">""")+COUNTIF(AZ18,">""")+COUNTIF(BE18,">""")+COUNTIF(BJ18,">""")+COUNTIF(BO18,">""")

I do know that the other rows will change the number 18 value (Row), so this is why I can't just paste and go, I would have to manually change the 18 value for the new rows... Thanks.  Register To Reply

2. try this - I think your columns are every 5 starting in column 7 but I did not check all of them

=SUMPRODUCT((MOD(COLUMN(A18:BZ18)-2,5)=0)*(A18:BZ18="<"))  Register To Reply

3. Thanks for attempting on this duane, but I only get a zero count using the formula you provided..

Yes, basically I am tyring to get a count if the fields in the specified row and columns are not empty. eg. (G18, L18, Q18 etc..) as you metioned it is about a 5 column skip to each field. I will however, be going down more rows to use the same formula, that is why I wanted it shortened.

Thanks for trying.. If you have any other ideas, please let me know...it's appreciated.  Register To Reply

4. Hi,

Why don't you upload a zipped copy of your file, so that we can visualize your request ...
Thanks

HTH
Carim   Register To Reply

5. Originally Posted by Mhz
Thanks for attempting on this duane, but I only get a zero count using the formula you provided..

Yes, basically I am tyring to get a count if the fields in the specified row and columns are empty. eg. (G18, L18, Q18 etc..) as you metioned it is about a 5 column skip to each field. I will however, be going down more rows to use the same formula, that is why I wanted it shortened.

Thanks for trying.. If you have any other ideas, please let me know...it's appreciated.
HI,

Duane's formula works, as:

=SUMPRODUCT((MOD(COLUMN(A18:BZ18)-2,5)=0)*(A18:BZ18))

to count the quantities, (Sum), and

=SUMPRODUCT((MOD(COLUMN(A18:BZ18)-2,5)=0)*(A18:BZ18<>""))

to count the items (CountIf)

hth
---  Register To Reply

6. I see it now - you wanted to count ">", not "<". Just change that in my formula as below. To add more (contiguous) rows, just change the ranges.

=SUMPRODUCT((MOD(COLUMN(A18:BZ20)-2,5)=0)*(A18:BZ20=">"))  Register To Reply

7. hth .. Hit it on the nail ! The bottom formula in your post works great for what I'm doing... and shortens all the + this and + thats.. Thanks Alot duane for your input... It is appreciated.

What exactly is the purpose of the .... -2,5 ?

Thanks hth and duane..  Register To Reply

8. MOD(COLUMN(A18:BZ20)-2,5)=0)

this expression looks at the column number in the range a:bz, subtracts 2, and then divides by 5. If the remainder of this is zero (ie it is column 2, 7, 12, 17, etc) then the rest of the calculation kicks in.

by the way, hth is "happy to help" - the other poster is Bryan Hessey.  Register To Reply

9. ## Why Countif give wrong results?

When I use countif for long code return wrong results, is there a limit for criteria or range length?  Register To Reply

10. ## Re: Can This Be Done..?

Welcome to the forum. We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

If you are not familiar with how to start a new thread see the FAQ: How to start a new thread  Register To Reply