+ Reply to Thread
Results 1 to 4 of 4

Countif totals

Hybrid View

  1. #1
    Registered User
    Join Date
    09-08-2007
    Posts
    5

    Countif totals

    I'm an excel noob so please forgive me if the answer to this is actually screamingly obvious.

    I have a worksheet where I enter daily sales of different products on seperate rows.At the end of each row is a column with the total sales figures.So far so easy but after that I want a column with the quantities sold and am trying to figure out how to do this.All I really need is to enter a formula into the cells in that column which gives the number of values excluding zeros which have been entered into the cells on each row.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    totals

    Perhaps this...

    A1: Product Name
    B1:Z1 (various numbers)

    This formula returns the count of numbers greater than zero in B1:Z1
    AB1: =COUNTIF(B1:Z1,">0")

    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    09-08-2007
    Posts
    5

    Totals

    Thanks, yes that certainly did help, all I've got to do now is figure out why. One further question. I've set the worksheet to accomodate what I expect the maximum sales to be, if I end up having to expand it by adding columns to accomodate increased sales can I make the formula update automatically or will I have to redo it each time?

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    totals

    There are several approaches you can use. Here are some options:

    1) Put the formula to the LEFT of the data and extend it's referenced range to column IV.

    2) Change the formula so it references a blank column to the right of the data. With data from B1:Z1, put the formula in AB1 and reference B1:AA1.
    AB1: =COUNTIF(B1:AA1,">0")
    If you need to insert more columns, put them BEFORE Col_AA.

    3) Reference a Dynamic Range Name in the formula. DRN's automatically expand and contract to accomodate the amount data.
    Debra Dalgleish's website has instructions:
    http://www.contextures.com/xlNames01.html#Dynamic

    Other approaches are more complicated and some of them involve volatile functions, which can make your workbook sluggish.

    Does that help.

+ 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