+ Reply to Thread
Results 1 to 10 of 10

How to get an instant sum

  1. #1
    Registered User
    Join Date
    01-14-2016
    Location
    toronto
    MS-Off Ver
    2013
    Posts
    5

    How to get an instant sum

    I have the following form based on a table:
    Please Login or Register  to view this content.
    fields “empname” and”salary” are locked, but the working is field is able the be switched between “yes” and “No” by the operator by a click.

    Is it possible that the "summary" shows the instant sum of salaries of the employs whose working status is “yes”? For example all “working” are yes and summary shows 2700. But the operator clicks on the working status of Steve and changes it to NO, and the summary right away shows 1200.

    i am not sure if this is doable on a form or report.
    thank you

  2. #2
    Registered User
    Join Date
    08-21-2012
    Location
    London
    MS-Off Ver
    Office 365 MAC
    Posts
    61

    Re: How to get an instant sum

    Perhaps SUMIF will work for you?
    Learner, making mistakes, asking daft questions.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16
    Posts
    45,550

    Re: How to get an instant sum

    Hi, welcome to the forum

    I agree that you could probably use SUMIF() for this
    =sumif(criteria-range, criteria, sum-range)
    to give more detailed help, please upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

    STOP PRESS: Forum Rules Updated September 2018! Please read them here.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2013 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    21,109

    Re: How to get an instant sum

    Is this not an Access query?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    STOP PRESS: Forum Rules Updated September 2018! Please read them here.
    If anyone has helped you towards solving a problem, then you can thank them by clicking on their reputation star bottom left.

  5. #5
    Forum Expert
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2010 primarily
    Posts
    1,462

    Re: How to get an instant sum

    You could use a DSUM function in a textbox.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16
    Posts
    45,550

    Re: How to get an instant sum

    Quote Originally Posted by AliGW View Post
    Is this not an Access query?
    or perhaps pulled in from another app, numbers under "salary" look wonky

  7. #7
    Registered User
    Join Date
    09-24-2018
    Location
    India
    MS-Off Ver
    MS office standard 2013
    Posts
    2

    Post Re: How to get an instant sum

    I hope this post is closed otherwise i have pasted the SUMIF example


    --------------------------
    Click on the star if you think someone helped you
    Attached Files Attached Files

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2013 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    21,109

    Re: How to get an instant sum

    Sorry for off-topic interjection:

    Although there is no official rule regarding this behaviour, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.

    Thanks!

  9. #9
    Registered User
    Join Date
    09-24-2018
    Location
    India
    MS-Off Ver
    MS office standard 2013
    Posts
    2

    Re: How to get an instant sum

    Quote Originally Posted by AliGW View Post
    Sorry for off-topic interjection:

    Although there is no official rule regarding this behaviour, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.

    Thanks!
    Hi,

    I understood your message. This was a simple use of SUMIF function so i didn't gave an explanation, however i completely agree with you and will do the explanation from next time onwards

    Thanks!

  10. #10
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 2016
    Posts
    13,967

    Re: How to get an instant sum

    @ariansman
    If you build your form based upon a query instead of bound to a form, then set the criteria in the yes/no field to yes. Then use an unbound text box and DSum in your form based upon the salary field.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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