+ Reply to Thread
Results 1 to 6 of 6

Array Formula required

Hybrid View

  1. #1
    Registered User
    Join Date
    05-24-2014
    Location
    Newman, Western Australia
    MS-Off Ver
    2007
    Posts
    3

    Array Formula required

    Hi guys

    I have attached a spreadsheet of data that I would like to reduce.

    In the workbook there is a set of data (rows 1 - 24) which are defined with random dates (row 2) and number criteria column A.

    In the table below that (rows 28 to 37) I have set out how I would like to present the data.

    So the question is; how to create an array formula that sums the above data months into the criteria of column A.

    if there is any help out there please point me in the right direction

    Cheers
    Attached Files Attached Files

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Array Formula required

    It seems like a regular formula will work.
    Using your posted workbook, put this formula in cell B29 and copy it across and down as far as you need
    Formula: copy to clipboard
    =IFERROR(INDEX($B$3:$FG$23,MATCH($A29,$A$3:$A$23,0),MATCH(B$28,$B$2:$FG$2,0)),"")

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    05-24-2014
    Location
    Newman, Western Australia
    MS-Off Ver
    2007
    Posts
    3

    Re: Array Formula required

    Hi Ron

    Thanks for the reply,

    When copied as you mentioned, close - I get a few cells filled out but this is not quite what I was after,

    I should explain a bit better;

    The function you provided identifies date matches from data table (B3-FG23) but I would actually like to cell B29 to sum all of the rows with 490 (A29) but the sum constrained to the month ending the date in B28.

    So for example that in cell C29 it will sum rows corresponding to A29 but between the dates 31/06/2011 and 30/07/2011 - etc

    I have recopied the spread sheet with a manual example of what I hope to acheive automatically. The real data I am using is quite extensive and doing it manually for all would incur significant human error

    I have tried sumif functions with a vlookup imbedded but i have not had it working yet

    let me know what you think

    cheers
    Attached Files Attached Files

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Array Formula required

    I notice that those aren't true month-end dates.

    Assuming you want to use fiscal-month-end dates
    try this regular formula copied across and down
    B29: =SUMPRODUCT(($A$3:$A$23=$A29)*(TEXT($B$2:$FG$2,"YYYYMM")=TEXT(B$28,"YYYYMM"))*(DAY($B$2:$FG$2)<=DAY(B$28))*$B$3:$FG$23)
    or maybe this:
    B29: =SUMPRODUCT(($A$3:$A$23=$A29)*($B$2:$FG$2>=(EOMONTH(B$28,-1)+1))*($B$2:$FG$2<=(B$28))*$B$3:$FG$23)
    If you meant to use true month-end dates, try this:
    B29: =SUMPRODUCT(($A$3:$A$23=$A29)*(TEXT($B$2:$FG$2,"YYYYMM")=TEXT(B$28,"YYYYMM"))*$B$3:$FG$23)
    Does that help?

    I have concerns that true end-of-month dates in the source data will be omitted, though. How do you want those handled?

  5. #5
    Registered User
    Join Date
    05-24-2014
    Location
    Newman, Western Australia
    MS-Off Ver
    2007
    Posts
    3

    Re: Array Formula required

    Hi Ron

    Yes that does the trick, thank you.

    It is so much more elegant than the options I was fiddling with.

    I will probably work to the EOM but initially I steered away from this because of how the data is used elsewhere.

    thanks again

  6. #6
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Array Formula required

    Hi Surfman,

    Your table layout seems to be poor for coding a SUMIFS formula, because, your data range is inconsistent. By inconsistent i mean the date format used, as I find just dates for the first 133 columns (from B to ED) correct and after that its a timestamp which is converted to d/mm/yyyy format. The Bench RL values aren't unique and are repeating as well (I'm referring to the values 490, 475, 460, etc. here).

    Please do rework on the layout of your data table.
    Last edited by Saarang84; 05-24-2014 at 11:27 PM.
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

+ 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. Array formula required to get the Employee details
    By zouraiz in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-23-2013, 03:21 PM
  2. [SOLVED] Help with Array formula required
    By johnstan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-12-2013, 09:06 AM
  3. Help Required with counting in Array
    By priamlau in forum Excel General
    Replies: 1
    Last Post: 05-30-2012, 03:42 PM
  4. Array formula help required
    By ZERKproject in forum Excel General
    Replies: 1
    Last Post: 03-16-2011, 06:57 AM
  5. [SOLVED] Array - Object required???
    By Buffyslay in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-23-2006, 03:30 AM

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