Results 1 to 2 of 2
  1. #1
    VictoriaAlbert is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    16

    Calculate Percentage based on previous column

    This is what the table looks like:



    Enrolled ID#
    Yes 118
    No 234
    No 312
    Maybe 513

    And I want to create a query that gives in column A the unique entries of the first column (Enrolled), column B the count of each entry, and column C the percentage that that count represents.

    So, the query result would look like
    Yes 1 25%
    No 2 50%
    Maybe 1 25%

    I have written column A and column B of the query, where column A is Field: Enrolled and Total: Group By, where column B is Field: ID# and Total: Count.

    I'm stumped on how to write the expression for column C. Any help would be greatly appreciated.

  2. #2
    apr pillai's Avatar
    apr pillai is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Alappuzha, India
    Posts
    209
    Use the Query as Source for another Query and write the following expression in a new Column:

    Code:
    PRCNT:[ColumnB]/DSUM("ColumnB","QueryName")
    Highlight the PRCNT column, display it's Property sheet and set the format property value to percent.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 12-17-2010, 11:06 AM
  2. Create percentage from column names
    By Brian62 in forum Queries
    Replies: 4
    Last Post: 12-03-2010, 09:01 AM
  3. Replies: 1
    Last Post: 04-15-2010, 02:07 AM
  4. How to calculate a percentage on form
    By jrockusa in forum Forms
    Replies: 1
    Last Post: 03-31-2010, 01:53 PM
  5. Use report to Calculate sum and percentage
    By bangemd in forum Reports
    Replies: 3
    Last Post: 05-28-2009, 12:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums