+ Reply to Thread
Results 1 to 3 of 3

ignore blank cells that are thew result of a formula

  1. #1
    Forum Contributor
    Join Date
    11-18-2014
    Location
    England
    MS-Off Ver
    365
    Posts
    132

    ignore blank cells that are thew result of a formula

    Hi - I have the following formula which is working out the average time between calls for call centre agents:

    =SUMPRODUCT(--(MONTH(Data!$A:$A)=Sheet2!$B$2),--(Data!$A:$A<>""),--(Data!$C:$C),--(Data!$D:$D=Sheet2!$B$1))/(SUMPRODUCT(--(MONTH(Data!$A:$A)=Sheet2!$B$2),--(Data!$A:$A<>""),--(Data!$C:$C<>""),--(Data!$D:$D=Sheet2!$B$1)))

    in the data
    Data column A is the dates
    Data Column C is the time between each call
    Data column D is the agent name

    However in the data column C is a formula to work out the time between calls but I have set it so that it only returns a result if the agent and date are the same as the previous line to stop it calculating time between calls by different agents or the same agent but different days. the formula in column C is

    =IF(AND(A1=A2,D1=D2),B2-B1," ")

    However the first formula doesn't work unless you remove this from the blank cells. I have set up two data sheets on the attached example one with the formula removed from blank cells in column C and one with it in. and the results show on Sheet 2 - any way I can fix this?

    Thanks
    J
    Attached Files Attached Files

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: ignore blank cells that are thew result of a formula

    I would suggest you use AVERAGEIFS as it will be considerably more efficient

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note: I wouldn't advise using the above, and certainly not the SUMPRODUCT, with entire column references.

    your original approach will fail as it is

    a) coercing Col C (via double unary) which will fail for non-numerics (incl. null strings)
    b) coercing Col A (c/o MONTH) which will fail for header row

    you can address both of the above by per below

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    but, as noted, don't use the above as it is horrendous in terms of performance.

  3. #3
    Forum Contributor
    Join Date
    11-18-2014
    Location
    England
    MS-Off Ver
    365
    Posts
    132

    Re: ignore blank cells that are thew result of a formula

    Hi XLent the averagifs does the trick! Thank you. I am not very good at using the date functions in formulas and the sumproduct one was from a sheet where the data and formulas were on a different workbook to each other.

    I must do some work and get to grips properly with the date functions.

    I have changed the column refs to use the data only I only added the full column refs to the example for speed!

    Thanks again

    J

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Formula to ignore blank cells with SUM?
    By Mr.Castle in forum Excel General
    Replies: 7
    Last Post: 08-20-2018, 05:12 PM
  2. Replies: 5
    Last Post: 05-11-2018, 08:54 PM
  3. CSV - Ignore Blank Formula Cells
    By almo136 in forum Excel General
    Replies: 1
    Last Post: 11-06-2017, 08:04 AM
  4. Replies: 6
    Last Post: 01-04-2017, 11:20 AM
  5. [SOLVED] Ignore blank cells with formulas or ignore NA() in a formula
    By guiismiti in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 03-24-2016, 02:13 PM
  6. Ignore blank cells using formula
    By tcubed13t in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-30-2014, 09:12 PM
  7. Getting formula to ignore blank cells
    By CDM in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-23-2006, 06:07 AM

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