+ Reply to Thread
Results 1 to 10 of 10

Can This Be Done..?

  1. #1
    Forum Contributor
    Join Date
    07-02-2006
    Location
    Love City, USA
    Posts
    183

    Question 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.
    Last edited by Mhz; 12-11-2006 at 09:45 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    07-11-2004
    Posts
    851
    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="<"))
    not a professional, just trying to assist.....

  3. #3
    Forum Contributor
    Join Date
    07-02-2006
    Location
    Love City, USA
    Posts
    183
    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.
    Last edited by Mhz; 12-12-2006 at 11:20 AM.

  4. #4
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

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

    HTH
    Carim

  5. #5
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote 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
    ---
    Si fractum non sit, noli id reficere.

  6. #6
    Valued Forum Contributor
    Join Date
    07-11-2004
    Posts
    851
    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=">"))

  7. #7
    Forum Contributor
    Join Date
    07-02-2006
    Location
    Love City, USA
    Posts
    183
    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..

  8. #8
    Valued Forum Contributor
    Join Date
    07-11-2004
    Posts
    851
    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.

  9. #9
    Registered User
    Join Date
    07-19-2009
    Location
    cairo
    MS-Off Ver
    Excel 2007
    Posts
    8

    Why Countif give wrong results?

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

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,271

    Re: Can This Be Done..?

    Administrative Note:

    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.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

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


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1