Results 1 to 7 of 7

COUNTIFS formula keeps counting blank cell with formulas.

Threaded View

  1. #1
    Forum Contributor Big.Moe's Avatar
    Join Date
    03-15-2012
    Location
    Corea, Maine, USA
    MS-Off Ver
    Excel 2010
    Posts
    262

    COUNTIFS formula keeps counting blank cell with formulas.

    I'm trying to get the average of three daily stats: unit price, unit cost, unit profit. The problem is that the data is not all neatly in a column, so I came-up with a formula using SUMIF divided by COUNTIFS that worked beautifully until I entered a negative value for unit profit. The criteria ">0" I was using no longer worked since I had to take in consideration negative values. So, I went with "<>0", then tried "<>""", then I tried using both. Each time, the formula seems to keep counting blank cells because there are formulas inside.

    My question is a simple one: How do you test for blank cells if they have a formulas in them?

    Don't laugh at it's grotesqueness, but here's my really ugly formula:
    Formula: copy to clipboard
    =IF($B9="","",
    (SUMIF('Daily - Jan'!$B$8:$B$138,$B9,'Daily - Jan'!G$8:G$138)+
    SUMIF('Daily - Jan'!$L$8:$L$138,$B9,'Daily - Jan'!Q$8:Q$138)+
    SUMIF('Daily - Jan'!$V$8:$V$138,$B9,'Daily - Jan'!AA$8:AA$138)+
    SUMIF('Daily - Jan'!$AF$8:$AF$138,$B9,'Daily - Jan'!AK$8:AK$138)+
    SUMIF('Daily - Jan'!$AP$8:$AP$138,$B9,'Daily - Jan'!AU$8:AU$138)+
    SUMIF('Daily - Jan'!$AZ$8:$AZ$138,$B9,'Daily - Jan'!BE$8:BE$138)+
    SUMIF('Daily - Jan'!$BJ$8:$BJ$138,$B9,'Daily - Jan'!BO$8:BO$138)+
    SUMIF('Daily - Jan'!$BT$8:$BT$138,$B9,'Daily - Jan'!BY$8:BY$138)+
    SUMIF('Daily - Jan'!$CD$8:$CD$138,$B9,'Daily - Jan'!CI$8:CI$138)+
    SUMIF('Daily - Jan'!$CN$8:$CN$138,$B9,'Daily - Jan'!CS$8:CS$138)+
    SUMIF('Daily - Jan'!$CX$8:$CX$138,$B9,'Daily - Jan'!DC$8:DC$138)+
    SUMIF('Daily - Jan'!$DH$8:$DH$138,$B9,'Daily - Jan'!DM$8:DM$138)+
    SUMIF('Daily - Jan'!$DR$8:$DR$138,$B9,'Daily - Jan'!DW$8:DW$138)+
    SUMIF('Daily - Jan'!$EB$8:$EB$138,$B9,'Daily - Jan'!EG$8:EG$138)+
    SUMIF('Daily - Jan'!$EL$8:$EL$138,$B9,'Daily - Jan'!EQ$8:EQ$138)+
    SUMIF('Daily - Jan'!$EV$8:$EV$138,$B9,'Daily - Jan'!FA$8:FA$138)+
    SUMIF('Daily - Jan'!$FF$8:$FF$138,$B9,'Daily - Jan'!FK$8:FK$138)+
    SUMIF('Daily - Jan'!$FP$8:$FP$138,$B9,'Daily - Jan'!FU$8:FU$138)+
    SUMIF('Daily - Jan'!$FZ$8:$FZ$138,$B9,'Daily - Jan'!GE$8:GE$138)+
    SUMIF('Daily - Jan'!$GJ$8:$GJ$138,$B9,'Daily - Jan'!GO$8:GO$138)+
    SUMIF('Daily - Jan'!$GT$8:$GT$138,$B9,'Daily - Jan'!GY$8:GY$138)+
    SUMIF('Daily - Jan'!$HD$8:$HD$138,$B9,'Daily - Jan'!HI$8:HI$138)+
    SUMIF('Daily - Jan'!$HN$8:$HN$138,$B9,'Daily - Jan'!HS$8:HS$138)+
    SUMIF('Daily - Jan'!$HX$8:$HX$138,$B9,'Daily - Jan'!IC$8:IC$138)+
    SUMIF('Daily - Jan'!$IH$8:$IH$138,$B9,'Daily - Jan'!IM$8:IM$138)+
    SUMIF('Daily - Jan'!$IR$8:$IR$138,$B9,'Daily - Jan'!IW$8:IW$138)+
    SUMIF('Daily - Jan'!$JB$8:$JB$138,$B9,'Daily - Jan'!JG$8:JG$138)+
    SUMIF('Daily - Jan'!$JL$8:$JL$138,$B9,'Daily - Jan'!JQ$8:JQ$138)+
    SUMIF('Daily - Jan'!$JV$8:$JV$138,$B9,'Daily - Jan'!KA$8:KA$138)+
    SUMIF('Daily - Jan'!$KF$8:$KF$138,$B9,'Daily - Jan'!KK$8:KK$138)+
    SUMIF('Daily - Jan'!$KP$8:$KP$138,$B9,'Daily - Jan'!KU$8:KU$138))
    /
    (COUNTIFS('Daily - Jan'!$B$8:$B$138,$B9,'Daily - Jan'!G$8:G$138,"<>0",'Daily - Jan'!G$8:G$138,"<>""")+
    COUNTIFS('Daily - Jan'!$L$8:$L$138,$B9,'Daily - Jan'!Q$8:Q$138,"<>0",'Daily - Jan'!Q$8:Q$138,"<>""")+
    COUNTIFS('Daily - Jan'!$V$8:$V$138,$B9,'Daily - Jan'!AA$8:AA$138,"<>0",'Daily - Jan'!AA$8:AA$138,"<>""")+
    COUNTIFS('Daily - Jan'!$AF$8:$AF$138,$B9,'Daily - Jan'!AK$8:AK$138,"<>0",'Daily - Jan'!AK$8:AK$138,"<>""")+
    COUNTIFS('Daily - Jan'!$AP$8:$AP$138,$B9,'Daily - Jan'!AU$8:AU$138,"<>0",'Daily - Jan'!AU$8:AU$138,"<>""")+
    COUNTIFS('Daily - Jan'!$AZ$8:$AZ$138,$B9,'Daily - Jan'!BE$8:BE$138,"<>0",'Daily - Jan'!BE$8:BE$138,"<>""")+
    COUNTIFS('Daily - Jan'!$BJ$8:$BJ$138,$B9,'Daily - Jan'!BO$8:BO$138,"<>0",'Daily - Jan'!BO$8:BO$138,"<>""")+
    COUNTIFS('Daily - Jan'!$BT$8:$BT$138,$B9,'Daily - Jan'!BY$8:BY$138,"<>0",'Daily - Jan'!BY$8:BY$138,"<>""")+
    COUNTIFS('Daily - Jan'!$CD$8:$CD$138,$B9,'Daily - Jan'!CI$8:CI$138,"<>0",'Daily - Jan'!CI$8:CI$138,"<>""")+
    COUNTIFS('Daily - Jan'!$CN$8:$CN$138,$B9,'Daily - Jan'!CS$8:CS$138,"<>0",'Daily - Jan'!CS$8:CS$138,"<>""")+
    COUNTIFS('Daily - Jan'!$CX$8:$CX$138,$B9,'Daily - Jan'!DC$8:DC$138,"<>0",'Daily - Jan'!DC$8:DC$138,"<>""")+
    COUNTIFS('Daily - Jan'!$DH$8:$DH$138,$B9,'Daily - Jan'!DM$8:DM$138,"<>0")+
    COUNTIFS('Daily - Jan'!$DR$8:$DR$138,$B9,'Daily - Jan'!DW$8:DW$138,"<>0")+
    COUNTIFS('Daily - Jan'!$EB$8:$EB$138,$B9,'Daily - Jan'!EG$8:EG$138,"<>0")+
    COUNTIFS('Daily - Jan'!$EL$8:$EL$138,$B9,'Daily - Jan'!EQ$8:EQ$138,"<>0")+
    COUNTIFS('Daily - Jan'!$EV$8:$EV$138,$B9,'Daily - Jan'!FA$8:FA$138,"<>0")+
    COUNTIFS('Daily - Jan'!$FF$8:$FF$138,$B9,'Daily - Jan'!FK$8:FK$138,"<>0")+
    COUNTIFS('Daily - Jan'!$FP$8:$FP$138,$B9,'Daily - Jan'!FU$8:FU$138,"<>0")+
    COUNTIFS('Daily - Jan'!$FZ$8:$FZ$138,$B9,'Daily - Jan'!GE$8:GE$138,"<>0")+
    COUNTIFS('Daily - Jan'!$GJ$8:$GJ$138,$B9,'Daily - Jan'!GO$8:GO$138,"<>0")+
    COUNTIFS('Daily - Jan'!$GT$8:$GT$138,$B9,'Daily - Jan'!GY$8:GY$138,"<>0")+
    COUNTIFS('Daily - Jan'!$HD$8:$HD$138,$B9,'Daily - Jan'!HI$8:HI$138,"<>0")+
    COUNTIFS('Daily - Jan'!$HN$8:$HN$138,$B9,'Daily - Jan'!HS$8:HS$138,"<>0")+
    COUNTIFS('Daily - Jan'!$HX$8:$HX$138,$B9,'Daily - Jan'!IC$8:IC$138,"<>0")+
    COUNTIFS('Daily - Jan'!$IH$8:$IH$138,$B9,'Daily - Jan'!IM$8:IM$138,"<>0")+
    COUNTIFS('Daily - Jan'!$IR$8:$IR$138,$B9,'Daily - Jan'!IW$8:IW$138,"<>0")+
    COUNTIFS('Daily - Jan'!$JB$8:$JB$138,$B9,'Daily - Jan'!JG$8:JG$138,"<>0")+
    COUNTIFS('Daily - Jan'!$JL$8:$JL$138,$B9,'Daily - Jan'!JQ$8:JQ$138,"<>0")+
    COUNTIFS('Daily - Jan'!$JV$8:$JV$138,$B9,'Daily - Jan'!KA$8:KA$138,"<>0")+
    COUNTIFS('Daily - Jan'!$KF$8:$KF$138,$B9,'Daily - Jan'!KK$8:KK$138,"<>0")+
    COUNTIFS('Daily - Jan'!$KP$8:$KP$138,$B9,'Daily - Jan'!KU$8:KU$138,"<>0"))))
    Last edited by Big.Moe; 03-02-2017 at 09:54 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need Help With COUNTIFS Formula That Includes Counting Only Unique Cells
    By Non-Prophet in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-19-2015, 10:40 PM
  2. Replies: 11
    Last Post: 09-15-2014, 02:36 AM
  3. Countifs formula counting the wrong column
    By hedefinesme in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-14-2014, 11:42 AM
  4. Replies: 2
    Last Post: 06-25-2014, 11:17 PM
  5. COUNTIFS not counting all numbers in one cell
    By taichi56 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 07-16-2013, 05:46 PM
  6. COUNTIFS is counting my blank, text fields
    By Hoosaskin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-30-2011, 01:14 PM
  7. Counting Non Blank Cells that Contain Formulas
    By jimswinder in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-21-2006, 06:40 PM

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