+ Reply to Thread
Results 1 to 25 of 25

Need help with Sumproduct formulas to exclude specific text/values in count and totals

  1. #1
    Registered User
    Join Date
    09-29-2019
    Location
    london
    MS-Off Ver
    365
    Posts
    18

    Need help with Sumproduct formulas to exclude specific text/values in count and totals

    Hi,

    Please find attached the file I need help with: https://trumpexcel.com/excel-leave-tracker/

    What I want to change in this file is to include “IN” and “OFF” on the calendar days that employees are working and have off days but I do not want these words to be counted in the "Leaves This Month", "Leaves This Year" and "Leave Breakup" as leave days. So I want to use it as an work attendance tracker too. All 10 employees have different start days and off days. Which formulas do I need to change please to achieve the aforementioned?

    Thank you very much in advance.
    Attached Files Attached Files
    Last edited by stingx; 10-13-2019 at 01:28 PM. Reason: requested by mod

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Need help with changing formulas

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    09-29-2019
    Location
    london
    MS-Off Ver
    365
    Posts
    18

    Re: Need help with changing formulas

    Please check now so I can get the help?

  4. #4
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    Place an example of your file. (no picture)

  5. #5
    Registered User
    Join Date
    09-29-2019
    Location
    london
    MS-Off Ver
    365
    Posts
    18

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    Hi Vraag,

    Thanks for the reply, I cannot post any files or links unfortunately but I placed the link of the whole file here which can be copied and pasted in a browser url and can be downloaded straight away: trumpexcelDOTcom/excel - leave - tracker/

    Just have to replace the DOT with a "." and remove the spaces before and after the hyphens "-"

  6. #6
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    I cannot post any files or links unfortunately
    Why not? You do not know how or is it too large?

  7. #7
    Registered User
    Join Date
    09-29-2019
    Location
    london
    MS-Off Ver
    365
    Posts
    18

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    Because the forum will not allow me to, when I try to attach files or post links, it gives me a warning as follows: "You are not allowed to post any kinds of links, images or videos until you post a few times."

    I can't even reply quoting your post as it is a link with code, it sucks.
    Last edited by stingx; 10-13-2019 at 12:45 PM. Reason: grammar

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,893

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? However, please give us an indication of the approximate number of rows of data you want the solution to work with (100, 1000, 100,000 or whatever). Please DO NOT attach a picture of an Excel sheet (I do not have the patience to re-type any/all your stuff before starting).

    1. It does NOT have to be your real sheet - mock up a SAMPLE if you need to. But not 1000's of rows!!! It makes manual checking so tedious. Whatever you do... make sure that all confidential information is removed first!!

    2. Make sure that your sample data are truly REPRESENTATIVE of your real data. For example, don't show text in a column if it's really a number. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    3. Make sure that your desired solution is also shown (mock up the results manually). To be honest, I am not interested in seeing a non-working formula... or a pile of blank cells. However, I am very interested in seeing your EXPECTED results in their EXPECTED location.

    4. Try not to use merged cells. They cause lots of problems and are DEFINITELY best avoided!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  9. #9
    Registered User
    Join Date
    09-29-2019
    Location
    london
    MS-Off Ver
    365
    Posts
    18

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    I can't post the links or attachments, I know how to but I can't because the it gives me a warning/error that I cannot post any attachments/links.

    The best I can do is to post a link like this: trumpexcelDOTcom/excel - leave - tracker/

    Just have to replace the DOT with a "." and remove the spaces before and after the hyphens "-"

  10. #10
    Registered User
    Join Date
    09-29-2019
    Location
    london
    MS-Off Ver
    365
    Posts
    18

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    I wish someone could open that link so they can see the file, can be frustrating when you are new and cannot post links or attachments.

  11. #11
    Registered User
    Join Date
    09-29-2019
    Location
    london
    MS-Off Ver
    365
    Posts
    18

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    This is the link to the file: https://trumpexcel.com/excel-leave-tracker/

  12. #12
    Registered User
    Join Date
    09-29-2019
    Location
    london
    MS-Off Ver
    365
    Posts
    18

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    Here is the attachment.

    Needed 10 posts to be able to post attachments.

    Thanks for any help in what am trying to achieve.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    09-29-2019
    Location
    london
    MS-Off Ver
    365
    Posts
    18

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    Anyone can help with this please?

    Thanks.

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    Needed 10 posts to be able to post attachments.
    No, you didn't need ten posts for attachments, only links. I will have a look at your file.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    OK - there's no signposting in the attached workbook. Which formula in which cells are you wanting to change?

  16. #16
    Registered User
    Join Date
    09-29-2019
    Location
    london
    MS-Off Ver
    365
    Posts
    18

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    Hi AliGW,

    Thanks for the reply and willing to help.

    Could you let me know what you mean by signposting so I can do that for you in the file?

    I think the formulas that need to change are in NJ8 to NJ57 and NK8 to NK57 because that is where the leaves are populated? I basically dont want the text "IN" and "OFF" in the calendar cells to be calculated in the "Leaves This Month" and "Leaves This Year".

    I have attached the excel file again with a some instructions, hopefully it will help make things a little clearer.

    Thanks again.
    Attached Files Attached Files
    Last edited by AliGW; 10-15-2019 at 04:04 AM. Reason: Please don't quote unnecessarily!

  17. #17
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,423

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    The following array entered formulas seem to yield the correct value (1).
    For cell NJ8:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    For cell NK8:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  18. #18
    Registered User
    Join Date
    09-29-2019
    Location
    london
    MS-Off Ver
    365
    Posts
    18

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    Hi JeteMC,

    Thank you so much for replying.

    I pasted the above formulas in the cells NJ8 and NK8 but I get the error "#VALUE".

    Any idea why this may be?

    Thank you so much in advance.
    Last edited by AliGW; 10-18-2019 at 04:19 AM. Reason: Please don't quote unnecessarily!

  19. #19
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,893

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    Did you read the comment about array formulae? CTRL-SHIFT-ENTER is needed, not just Enter.

  20. #20
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,423

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    Since the formulas originally in those cells (when the attachment in post #16 is opened) were array entered I assumed that the you knew about using Ctrl, Shift and Enter for activation, sorry not to have made the clarification.
    Let us know if you have any questions.

  21. #21
    Registered User
    Join Date
    09-29-2019
    Location
    london
    MS-Off Ver
    365
    Posts
    18

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    Quote Originally Posted by Glenn Kennedy View Post
    Did you read the comment about array formulae? CTRL-SHIFT-ENTER is needed, not just Enter.
    Sorry, I am not very good with formulas, should have mentioned this.

  22. #22
    Registered User
    Join Date
    09-29-2019
    Location
    london
    MS-Off Ver
    365
    Posts
    18

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    Quote Originally Posted by JeteMc View Post
    Since the formulas originally in those cells (when the attachment in post #16 is opened) were array entered I assumed that the you knew about using Ctrl, Shift and Enter for activation, sorry not to have made the clarification.
    Let us know if you have any questions.
    Hi JeteMc,

    No need for apologies, you did nothing wrong and I should have made myself clearer.

    It now works, just wanted to say a huge thank you for your assistance as nobody has been able to help me with an answer at all with this, even the creator of the spreadsheets replied that the only way was to highlight the cells. I cannot thank you enough for this.

    Just one more question if possible for you to answer please, would be very much grateful:

    1) How would I exclude any other code in the list like you have done with the “IN” and “OFF” in the formula, for example how would I exclude “OV” from the code list if I wanted to. I want to know how to exclude the existing codes or when I add new codes so I can do it myself as it is not very clear to me?

    Thanking you ever so much for all your help!

  23. #23
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,423

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    The portions of the formula that exclude "IN" and "OFF" in the month formula are: *(OFFSET($A8,0,31*($A$3-1)+1,1,31)<>"IN")*(OFFSET($A8,0,31*($A$3-1)+1,1,31)<>"OFF")*
    In the year formula they read: *(OFFSET($A8,0,1,1,372)<>"IN")*(OFFSET($A8,0,1,1,372)<>"OFF")*
    One option would be to continue that trend and add a segment such as *(OFFSET($A8,0,1,1,372)<>"OV")* for each code you wish to exclude.
    Possibly a better method would be to append the original month array formula so that it reads as follows:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note that criteria 1 for the COUNTIFS function is a range (NX12:NX14) that includes "IN", "OFF", and "OV". If a new code is added which should excluded from the count then the range can be extended to include that code. For instance if "CO" should be included the range could be modified to read NX12:NX15.
    A similar array formula is used for the yearly count.
    Let us know if you have any questions.
    Attached Files Attached Files

  24. #24
    Registered User
    Join Date
    09-29-2019
    Location
    london
    MS-Off Ver
    365
    Posts
    18

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    Quote Originally Posted by JeteMc View Post
    The portions of the formula that exclude "IN" and "OFF" in the month formula are: *(OFFSET($A8,0,31*($A$3-1)+1,1,31)<>"IN")*(OFFSET($A8,0,31*($A$3-1)+1,1,31)<>"OFF")*
    In the year formula they read: *(OFFSET($A8,0,1,1,372)<>"IN")*(OFFSET($A8,0,1,1,372)<>"OFF")*
    One option would be to continue that trend and add a segment such as *(OFFSET($A8,0,1,1,372)<>"OV")* for each code you wish to exclude.
    Possibly a better method would be to append the original month array formula so that it reads as follows:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note that criteria 1 for the COUNTIFS function is a range (NX12:NX14) that includes "IN", "OFF", and "OV". If a new code is added which should excluded from the count then the range can be extended to include that code. For instance if "CO" should be included the range could be modified to read NX12:NX15.
    A similar array formula is used for the yearly count.
    Let us know if you have any questions.
    Hi JeteMc,

    Thanks for the reply, this has really helped.

    I used the first version as the second formula when added at the end, is giving me a minus total.

    Thanks again for your help, you have been life saver with this!

  25. #25
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,423

    Re: Need help with Sumproduct formulas to exclude specific text/values in count and totals

    I am glad that you are able to work with the first formula, however I don't understand how the second formula could return a negative value. Could you post an example?
    Let us know if you have any questions.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. formulas changing unexpectedly
    By Techtrainer1bv in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-05-2017, 05:06 PM
  2. Numbers in formulas keep changing
    By JKenya in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-23-2016, 07:26 AM
  3. Formulas keep changing
    By Scorpvin in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-04-2014, 07:03 PM
  4. Changing table formulas
    By AhmedIsmail759 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-03-2013, 02:19 AM
  5. Replies: 5
    Last Post: 11-03-2012, 05:10 PM
  6. CONCATENATE Formulas Changing
    By ThaGonz in forum Excel General
    Replies: 4
    Last Post: 09-03-2011, 06:15 PM
  7. Pasting formulas without changing them.
    By Hodged in forum Excel General
    Replies: 3
    Last Post: 11-28-2006, 01:27 PM

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