+ Reply to Thread
Results 1 to 8 of 8

Array formula and the #DIV/0 error

  1. #1
    Registered User
    Join Date
    08-15-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    18

    Question Array formula and the #DIV/0 error

    Hi there,

    I am both new to the forum and also to Excel but have been asked to analyse a database as part of my new role. For a bit of context I work in a health service and I am trying to find out is the average of those who have completed treatment. The database is set up to record this in different ways (as outlined below) and I need the formula to consider these different variables in order to work out the average.

    The array formula I have researched and tried to run so far is =AVERAGE(IF(A_treatment="complete",IF(REFDIS!$T$3:$T$14=1,IF(A_N1to1>0,A_N1to1))))

    A_treatment refers to the clients treatment status so if it is marked as "complete" or "incomplete"
    REFDIS(the name of the excel spreadsheet) refers to the column of the database which marks whether someone is receiving 1:1 treatment (marked as 1) or not (marked as 0)
    A_N1to1 refers to number of sessions the client has had. The database has been set up to automatically change a clients treatment status from incomplete to complete once they have had 4 or more sessions.

    I am working with a small database at the moment (only 12 patients-T3 to T14 in my database) so i can try and familiarise myself with the formulas...I have never run an array formula before so apologies if this post is very basic or if i am not explaining myself well. From what I can see the formula is referring to the right columns on the database (and i am pressing ctrl, shift, enter) yet the division error keeps coming up. I can only think that somehow I haven't defined what to calculate the average from?

    I am at a bit of a loss and Google is not turning up anything really so any help would be much appreciated.

    Many thanks

  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

    Re: Array formula and the #DIV/0 error

    Without seeing some sample data, I can only guess what the issue is.
    I'm assuming A_Treatment and A_N1to1 are named ranges. Perhaps they are not the same size as REFDIS!$T$3:$T$14
    Or maybe, none of the records in REFDIS!$T$3:$T$14 are = 1?

    However, since you are using Excel 2010, you might be able to use this function in a regular (non-array) formula:
    Please Login or Register  to view this content.
    Is that something you can work with?
    Last edited by Ron Coderre; 08-15-2015 at 09:03 AM.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    08-15-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    18

    Re: Array formula and the #DIV/0 error

    Hi Ron,

    Thank you for your help and reply.

    Yes A_treatment and A_N1to1 are named ranges but they are also the same size as the named range within REFDIS.
    Interestingly I just tried your code and it came out with the same error...

    Do you have any further thoughts about what might be causing this?

    Thanks

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Array formula and the #DIV/0 error

    Could you post a sample file as this will help in diagnosing the problem.

    Click "Go Advanced" then the "paper clip" icon to upload a file.

  5. #5
    Registered User
    Join Date
    08-15-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    18

    Re: Array formula and the #DIV/0 error

    Hi,

    Please see attached dataset....this is a copy of what I have been working with to get used to excel and various formulas.

    Thanks
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Array formula and the #DIV/0 error

    What cell is the formula in? I tried Ron's formula and had a result of 4.

    What is the expected result?

  7. #7
    Registered User
    Join Date
    08-15-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    18

    Re: Array formula and the #DIV/0 error

    Hi John,

    Thank you-I just retried Ron's formula and I also got an answer of 4...not sure why i didn't earlier.

    With a bigger dataset would it be ok to continue using this formula do you think? it would make life easier!

    Thank you all for looking through and helping me-it is much appreciated.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Array formula and the #DIV/0 error

    Yes ... continue with Ron's formula.

    If all is OK can you mark the thread as SOLVED - "Thread Tools" on first posting

    Thank you.

+ 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. Array formula error
    By vonmunchy in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 11-13-2013, 09:42 AM
  2. [SOLVED] #VALUE! Error In With Array Formula
    By DDM64 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-29-2013, 11:17 AM
  3. Array formula error
    By tkellymd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2012, 02:50 PM
  4. Dragging Array Formula gives #REF Error
    By brodielepi in forum Excel General
    Replies: 2
    Last Post: 01-11-2012, 12:22 PM
  5. #N/A Error in Array Formula
    By jrarmstrong4 in forum Excel General
    Replies: 7
    Last Post: 11-30-2011, 06:02 PM
  6. Error #NUM! - Array Formula
    By Shermaine2010 in forum Excel General
    Replies: 2
    Last Post: 08-21-2011, 03:44 AM
  7. Error Generated from Array formula
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-14-2005, 09:06 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