Results 1 to 4 of 4
  1. #1
    spyldbrat is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2015
    Posts
    73

    Formula Question?

    Hi,

    I not very Access savvy, but I was wondering how to do two specific excel formulas in Access?

    I have rows of data for each employee. Each row shows the pay week and the amount of hours worked in that pay period.



    The first formula I need adds all the hours worked each week in the row. The excel formula looks like this: =SUM(C2:AI2)
    The second formula creates an accrual based on the amount of hours worked each week. The excel formula looks like this: =+AJ2/30 (AJ represents the total hours from the above formula)

    How can I create these formulas in Access for each row of data?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Forget everything you know about spreadsheets when working with relational database.

    Not sure what you mean by "adds all the hours worked each week in the row". What is field structure of table?

    What do you mean by 'accrual' - want to add up all the weeks? Maybe you need to do an aggregate (GROUP BY) Totals query to summarize the hours data by employee. Use the query builder. Lots of info on web about building queries. Any introductory Access book will cover this.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Further to June7's remarks -

    You cannot import data from Excel into Access, keep the same structure, and expect it to work the same way. It doesn't - the concept of Ranges does not exist in Access, even within the same record (row).

    I suggest you find a good reference on database design, and become familiar with the concept of data normalization. A properly normalized data structure from the start will save you from all kinds a grief later on.

    Here is one reference: http://sbuweb.tcu.edu/bjones/20263/A...sDB_Design.pdf
    Last edited by John_G; 12-24-2015 at 12:11 AM. Reason: added reference link

  4. #4
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    spyldbrat, how are you trying to display this data? as an avid excel user I too was confused on how to do equations that I was used to doing easily in excel. if you are trying to take data from a table and display the result on a form, I would suggest doing some research on how queries work, then on how to base a form on a query. a big difference between excel and access is that in access we don't want to keep the results longer than the user is viewing it. we can always recalculate it when needed, no need is taking up storage space for results as long as we have the root information. what you are describing is a simple query with a groupby in the employee field and a sum in the hours field of a query. suggest doing a google search on access forms based on queries.

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

Similar Threads

  1. Replies: 19
    Last Post: 07-13-2015, 10:15 AM
  2. Replies: 3
    Last Post: 05-20-2014, 05:43 PM
  3. Replies: 3
    Last Post: 05-03-2012, 05:39 PM
  4. Field in query formula question
    By jcaptchaos2 in forum Access
    Replies: 7
    Last Post: 04-24-2011, 06:32 PM
  5. Formula question on Report
    By FestoAccessBuilder in forum Reports
    Replies: 0
    Last Post: 03-10-2009, 10:21 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