Results 1 to 5 of 5
  1. #1
    jbp is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2013
    Posts
    3

    how to use a calculated field to get the average of 4 text fields

    I'm new to Access, so this may seem absurd...



    I have 4 texts fields [DEVICE INSTALL] , [INSTRUMENT STAND], [BRACKETS RACEWAY SUPPORTS], [TUBING CAPILLARY]
    all can be either a percentage from 1-100 or "N/A" except [DEVICE INSTALL].

    I would like to calculate the [percentage complete]

    my calculation in the field is as follows:
    ([DEVICE INSTALL]+
    IIf([INSTRUMENT STAND]="N/A",100,[INSTRUMENT STAND])+
    IIf([TUBING CAPILLARY]="N/A",100,[TUBING CAPILLARY])+
    IIf([BRACKETS RACEWAY SUPPORTS]="N/A",100,[BRACKETS RACEWAY SUPPORTS]))
    /4

    this seems to work to a degree. but for some reason when the [INSTRUMENT STAND] value is not "N/A" the percentage calculated is a wacky value much higher than 100.

    Why is this and how might I fix it?
    and if anyone might be interested, how could I possibly change my division #?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Sounds like you may need to review your use of text fields. Seems you may want to try numeric fields.

  3. #3
    jbp is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2013
    Posts
    3
    Quote Originally Posted by orange View Post
    Sounds like you may need to review your use of text fields. Seems you may want to try numeric fields.
    I considered that but the problem is I need to be able to enter an "N/A" text value if either of the fields do not apply. And a Numeric Field won't allow it.

    What to Do...

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    You could use a negative value, check for such and display "N/A" for presentation.

  5. #5
    jbp is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2013
    Posts
    3
    found a solution:

    (int([DEVICE INSTALL])+
    IIf([INSTRUMENT STAND]="N/A",100,int([INSTRUMENT STAND]))+
    IIf([TUBING CAPILLARY]="N/A",100,int([TUBING CAPILLARY]))+
    IIf([BRACKETS RACEWAY SUPPORTS]="N/A",100,int([BRACKETS RACEWAY SUPPORTS])))
    /4

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

Similar Threads

  1. Replies: 2
    Last Post: 01-30-2013, 06:48 AM
  2. Can Calculated Field (Text) Be Edited?
    By melhzy in forum Access
    Replies: 1
    Last Post: 11-26-2012, 12:12 PM
  3. Replies: 6
    Last Post: 10-17-2012, 03:01 PM
  4. Replies: 4
    Last Post: 01-04-2012, 02:35 PM
  5. Replies: 13
    Last Post: 05-28-2010, 11:57 AM

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