+ Reply to Thread
Results 1 to 8 of 8

Creating a dynamic bar chart based on counting blank cells.

  1. #1
    Registered User
    Join Date
    11-18-2010
    Location
    Sussex, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Creating a dynamic bar chart based on counting blank cells.

    Hi all,

    I am having some difficulty using dynamic ranges to create a few graphs and was hoping someone out there could help!

    A smaller version of my data can be seen in the attached Excel sheet:

    (Note treatment days are in ascending order within ‘end of treatment reason’ categories.)

    I need to create two plots, as shown in the spreadsheet.

    1) A bar chart displaying the patients who are not on treatment with reason for treatment discontinuation along the x axis, and treatment duration along the y axis.
    I have managed to successfully make this graph using dynamic ranges. I used the following:

    Insert > Name > Define:
    end_trt_reas: =OFFSET(Listing!$F$5,1,0,COUNTA(Listing!$F:$F)-1)
    end_trt_reas_valA: =OFFSET(end_trt_reas,0,1)

    Chart Wizard (Series Tab):
    Name: =Listing!$F$3
    Values: =Listing!end_trt_reas_valA
    Category (X) axis labels: =Listing!end_trt_reas



    2) This is the chart that is causing trouble! A bar chart displaying only the patients who are on treatment with a patient count along the x axis, and treatment duration along the y axis.

    In a similar way to above, I tried to define names that would work, however as this graph relies on taking the number of blank cells in column F, the chart always errored. Of course new entries will be added to the date, hence why a dynamic range is required. I also need the patient count along the x-axis.

    If anyone has a relatively good knowledge of dynamic ranges, I'd be really grateful for their help!

    Feel free to post if I haven't made myself clear enough.

    Many thanks,

    Katie
    Attached Files Attached Files
    Last edited by kharmer; 11-22-2010 at 05:23 AM. Reason: Change attachment from doc to xls.

  2. #2
    Registered User
    Join Date
    11-18-2010
    Location
    Knoxville, TN
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Creating a dynamic bar chart based on counting blank cells.

    countblank?

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Creating a dynamic bar chart based on counting blank cells.

    I'm not very inclined to open a large Word doc with just pictures. Why don't you post an Excel file with some sample dummy data at a fraction of the file size.

  4. #4
    Registered User
    Join Date
    11-18-2010
    Location
    Sussex, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Creating a dynamic bar chart based on counting blank cells.

    Hello,

    I have now updated the thread so the attachment is an xls file, and the accompanying description is in the initial wall post.

    zanehitchcox, I have tried using COUNTBLANK by using it inplace of COUNTA, however this ends up selecting the entire column, and not just the blanks (unless I am doing something wrong...).

    Again, if anyone could take a look, that would be great! :]

    Thanks,
    Katie

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Creating a dynamic bar chart based on counting blank cells.

    Hello,

    I'm not quite sure what you mean with "number of active patients". The patient number? A running count of patients?

    I've created these two dynamic ranges and plugged them into the chart

    Please Login or Register  to view this content.
    see attached. We can take it from there. Pipe up with what you need.

    cheers,
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-18-2010
    Location
    Sussex, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Creating a dynamic bar chart based on counting blank cells.

    Thank you so much, already that has helped massively. Number of patients I intended to mean the patient count, i.e. beginning at 1 and ending at (in this case) 50. Is this possible? This is not a major concern if it isn't.

    Thanks again!

  7. #7
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Creating a dynamic bar chart based on counting blank cells.

    to get a total count on patients, both off and on treatment, you can use

    =counta($A:$A)

    to get a count of only those patients on treatment, you can use

    =COUNT(ActivePatients)

    Please let me know what you want to see in the X axis of the chart.

  8. #8
    Registered User
    Join Date
    11-18-2010
    Location
    Sussex, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Creating a dynamic bar chart based on counting blank cells.

    Hi teylyn,

    Thanks so much for your help. My graph is now exactly what I was after.

    Thanks again, kharmer

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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