+ Reply to Thread
Results 1 to 8 of 8

Sumproduct, Month, Ignore text

  1. #1
    Registered User
    Join Date
    06-22-2009
    Location
    Lincoln
    MS-Off Ver
    Excel 2003
    Posts
    68

    Sumproduct, Month, Ignore text

    I've seen various solutions to problems similar to mine, however, as is always the way, my problem is everso slightly different.

    I have a sumproduct formula that looks like this:

    Please Login or Register  to view this content.
    It works well and does what I ask of it.

    Now, my problem is that I want to add in a section that deals with column A in the same manner as the formula deals with column B (i.e. MONTH(Hours!A18:A105)=4) which should work fine, except column A also contains text that is throwing off the formula resulting in a #Value result. I've seen solutions that deal with things like If(Istext(???)... but the Month function seems to be causing me a bit of an issue.

    Any thoughts?
    Last edited by jennyaccord; 06-14-2012 at 06:30 AM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Sumproduct, Month, Ignore text

    can you provide some examples representative of what is in column A and what the calculation should include/exclude?
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Sumproduct, Month, Ignore text

    Not sure What your end goal is?

    Try either of these array formulae ...

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Confirm with Ctrl+Shift+Enter not just Enter
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  4. #4
    Registered User
    Join Date
    06-22-2009
    Location
    Lincoln
    MS-Off Ver
    Excel 2003
    Posts
    68

    Re: Sumproduct, Month, Ignore text

    Thanks for the reply Tigeravatar (and you too Marcol. You replied whilst I was sorting out my post).

    The formula is for part of a complicated booking system:

    Columns A&B contain the From and To dates, with the dates formatted dd/mm/yyyy.
    Column C contains one of 4, 2 letter codes denoting where the equipment has been taken from.
    Column G contains the length of work time, in hours, you will have the piece of equipment (with a work day being 7.5hrs).

    What I'm looking to do is calculate how many work hours a piece of equipment has been out of a locker in any given month.

    For example, on entry the information is set up like this:

    Please Login or Register  to view this content.
    The sheet has been set up so that new entries are added into the next available empty row but, at the click of a button, they are organised in date order under the correct headings, like this:

    Please Login or Register  to view this content.
    What I would like to be able to do is, using the sumproduct formula, pull out only those items from the front locker (FL) that were removed in April (so it would ignore the January ones). I need to use both columns A&B as some dates may straddle a month. If an item was removed for 10 days starting on 30th April, as far as our records are concerned, the days it was out of the locker in May, still count as an April hire, if you catch my drift (it's engineering logic I think).

    If I pull the information into a blank sheet and take out the headings in column A, the sumproduct formula I mentioned initially works fine. It's the headings that are throwing the formula off and I can't remove them. And, given the way the sheet is set up, the headings move whenever new information is added so I can't even write the formula to ignore certain cells. I just can't work out how to write the formula to get it to ignore text but still look for April (i.e. Month(A18:A105)=4).

    Hope that makes sense.

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Sumproduct, Month, Ignore text

    jennyaccord,

    Attached is an example file based on the criteria you described. I'm still not sure what you want the output to be, but the workbook includes both of the formulas Marcol suggested, and they both result in 6.875 with your provided sample data. Is that what you're looking for?
    Attached Files Attached Files

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Sumproduct, Month, Ignore text

    Does the first formula I offered give you the result you need?

    Assuming that your headers are in row 17, and not row 18

    [EDIT]
    Never saw your reply Tiger, browser delay in refreshing seems to be a problem again.
    Attached Files Attached Files
    Last edited by Marcol; 06-07-2012 at 12:53 PM.

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Sumproduct, Month, Ignore text

    I have a feeling that the last part of the formula should be ...
    *Hours!G18:G105/24
    not
    *SUM(Hours!G18:G105/24)

    Resulting in 30/24 = 1.25 days

    But I'm not sure of the logic of dividing the hours by 24 to get days in this case ...
    Last edited by Marcol; 06-07-2012 at 01:13 PM.

  8. #8
    Registered User
    Join Date
    06-22-2009
    Location
    Lincoln
    MS-Off Ver
    Excel 2003
    Posts
    68

    Re: Sumproduct, Month, Ignore text

    Thanks guys, your help has been invaluable. The formula Marcol gave works brilliantly.

    Sorry for the late reply, I've been out of the office for days.

    Thanks again. It's helpful advice like this that keeps me coming back here.

+ 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