+ Reply to Thread
Results 1 to 9 of 9

How can I use a SUM array formula that ignores letters?

  1. #1
    Registered User
    Join Date
    01-12-2014
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Question How can I use a SUM array formula that ignores letters?

    Good Morning,

    I have two array formula's, one to count hours, the other to count days. Both are based on: type of worker, day of week, and week number. The problem is if I use a "V" or "T" for vacation or training, then the array formula will not work. Currently I leave the field blank if they are not working, but it would be nice to see whether they are on vacation or training. Is there a way i can have my cake and eat it too?

    Counting Days
    {=SUM(($E$5:$MN$50>0)*($B$5:$B$50=$D56)*($E$3:$MN$3=F$54)*($E$2:$MN$2=$E$67))}

    Counting Hours
    {=SUM(($E$5:$MN$50)*($B$5:$B$50=$D56)*($E$3:$MN$3=F$54)*($E$2:$MN$2=$E$67))}

    Here is a breakdown of what each of the ranges mean:
    • $E$5:$MN$50 is the area which the hours are forecasted
    • $B$5:$B$50 is the column for which type of worker (Electrician, Pipefitter, etc)
    • $D56 is the specific type of worker we are counting for
    • $E$3:$MN$3 is a row with all the week days ("Fri, Sat, Sun...)
    • F$54 is the specific day we are counting for
    • $E$2:$MN$2 is a row with all the week numbers
    • $E$67 is the specific week number we are counting for

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: How can I use a SUM array formula that ignores letters?

    Can you show what kinds of data in E5:MN50? "V","T",1,or "X"? which can be or can not be counted?
    Quang PT

  3. #3
    Registered User
    Join Date
    01-12-2014
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: How can I use a SUM array formula that ignores letters?

    The values in E5:MS:50 are supposed to be 0-12, V, T, or X. If a letter is there i get an output of #Value! with a message "A value used in the formula is of the wrong data type"

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: How can I use a SUM array formula that ignores letters?

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    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

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: How can I use a SUM array formula that ignores letters?

    For the hours try this formula

    =SUMPRODUCT($E$5:$MN$50,($B$5:$B$50=$D56)*($E$3:$MN$3=F$54)*($E$2:$MN$2=$E$67))

    and for days

    =SUMPRODUCT(($E$5:$MN$50>0)*ISNUMBER($E$5:$MN$50)*($B$5:$B$50=$D56)*($E$3:$MN$3=F$54)*($E$2:$MN$2=$E$67))

    (I'm assuming you don't count days with letters or 0, just numbers greater than zero, is that right?)

    using SUMPRODUCT means you don't need to "array enter" those formulas
    Last edited by daddylonglegs; 02-15-2014 at 04:26 PM.
    Audere est facere

  6. #6
    Registered User
    Join Date
    01-12-2014
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: How can I use a SUM array formula that ignores letters?

    @FDibbins: Unfortunately i cannot attach my workbook because our IT policy is restricting me.

    @daddylonglegs: I was not aware that you could bypass CSE with SUMPRODUCT, thanks for the tip Unfortunately using the SUMPRODUCT formula does not work any better as the CSE with the SUM formula. The formula for counting days just counts how many cells are greater than 0. The array works great when only numbers are involved, but breaks down whenever letters or strings are involved. I tried nesting IF and ISNUMBER like this:

    =SUMPRODUCT(IF(ISNUMBER($E$5:$MN$50),($E$5:$MN$50),0)*($B$5:$B$50=$D56)*($E$3:$MN$3=F$54)*($E$2:$MN$2=$E$67))

    Unfortunately it did not work, all i got returned was zero regardless if i had any letters in the array or not. Anyone have any other ideas?

  7. #7
    Registered User
    Join Date
    01-12-2014
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: How can I use a SUM array formula that ignores letters?

    Hey guys, i got it figured out. Apparently when using the SUMPRODUCT Formula, you can use comma instead of *. If you use a comma, it ignores the text... Thanks for your responses but this thread is considered solved.

    Here are the working formula's:

    Counting Hours
    =SUMPRODUCT(($E$5:$MN$50),($B$5:$B$50=$D56)*($E$3:$MN$3=AJ$54)*($E$2:$MN$2=$I$67))

    Counting Days
    =SUMPRODUCT(($E$5:$MN$50>0),($B$5:$B$50=$D56)*($E$3:$MN$3=AJ$54)*($E$2:$MN$2=$I$67))

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: How can I use a SUM array formula that ignores letters?

    If you look at my suggestion the hours formula uses a comma.

    Your days formula, as quoted here, will always return zero, if you use * instead of comma it should return a result but without the ISNUMBER part it will also count the days with "V" and "T" etc. because any letter is deemed to be "greater than zero" - I think you need to use the version I suggested
    Last edited by daddylonglegs; 02-15-2014 at 05:46 PM.

  9. #9
    Registered User
    Join Date
    01-12-2014
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: How can I use a SUM array formula that ignores letters?

    @daddylonglegs: You sir are awesome. My applogies, and I have added rep as you deserve it! Please disregard my last post, I must have not copied it properly the first time. Thanks again!

+ 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. Replies: 2
    Last Post: 07-11-2012, 08:58 AM
  2. Formula/macro that ignores cells nonblanks
    By pmarques in forum Excel General
    Replies: 6
    Last Post: 02-10-2006, 10:55 AM
  3. formula ignores last infor - please help
    By sonar in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-22-2005, 05:00 AM
  4. Replies: 2
    Last Post: 07-05-2005, 06:05 PM
  5. Min Value using array ignores Zero
    By mauddib in forum Excel General
    Replies: 2
    Last Post: 02-16-2005, 03:04 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