+ Reply to Thread
Results 1 to 10 of 10

Exclude blank/FALSE cells in in Excel array IF formula output

  1. #1
    Registered User
    Join Date
    08-02-2012
    Location
    Sweden
    MS-Off Ver
    Office 2010
    Posts
    5

    Exclude blank/FALSE cells in in Excel array IF formula output

    I am having difficulties with making an array formula work the way I want it to work.

    Out of a column of dates which is not sorted, I want it to extract values into a new column. The formula below identifies the required cells of a given month and year, but they appear in their original row rather than on top of the output range. Moreover, I want all ""/FALSE cells to be excluded from the output array.

    Please Login or Register  to view this content.
    In fact, the $I$15:$I$1346 should be dynamic and go to the last filled range (I could make a named range for that)

    Part two is to expand on that formula so that it calculates the data that is an two column offset of the data described above.

    Is the above possible to build into one cell probably with a combination of IF, INDEX, SMALL and maybe others?

    I'm not looking for a filter solution. Hope the above is clear enough and that you can help!

    Here's a shortened sample layout:

    x A B C
    1 Date Series_A Series_B
    2 03/01/2011 45 20
    3 04/01/2011 73 30
    4 06/01/2011 95 40
    5 08/01/2011 72 50
    6 06/02/2011 5 13
    7 09/02/2011 12 #N/A
    8 05/02/2011 23 65
    9 07/03/2011 12 65

    Then I want three input cells for the year and and the month and series name (index/match, as there are many more columns with data). If it would be 2011, Feb and Series_A, I want it to calculate the average for that month. In this case it would be (5+12+23)/3. If it would be Feb-2011 and Series_B instead, which has an error, it should show (13+65)/2 rather than an error.

    Aside from that I want a separate which will output an array with the data instead without 'holes' in between and with the right 'length'. Example for Feb-2011 in Column C:
    x A B C D
    1 Date Series_A Desired Output Output based on f above
    2 03/01/2011 45 5
    3 04/01/2011 73 12
    4 06/01/2011 95 23
    5 08/01/2011 72
    6 06/02/2011 5 5
    7 09/02/2011 12 12
    8 05/02/2011 23 23
    9 07/03/2011 12

    If if then run a =ISBLANK(C5) it should be true, rather than =""=C5

  2. #2
    Registered User
    Join Date
    03-08-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    3

    Problem using autofill with fixed rows in a formula

    Hello all,

    I'm trying to autofill "vertically" in a spreadsheet using a formula which loads value from a different sheet.

    Lets say I have cell (A1 for example) ='2013'!A39

    Now I want to fill A2-A30 in a way that the formula updates to ='2013'!B39, ='2013'!C39, ='2013'!D39...and so on

    I've tried using ='2013'!A$39, but this only copies the formula as it is. When I try to autofill cell A2-A30, the formula still is ='2013!A$39

    Is this possible?

    Thank you!

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Exclude blank/FALSE cells in in Excel array IF formula output

    Daniel,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Registered User
    Join Date
    03-08-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Exclude blank/FALSE cells in in Excel array IF formula output

    Quote Originally Posted by arlu1201 View Post
    Daniel,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    Sorry, I thought I had created a new thread. This was just clumsy...

  5. #5
    Registered User
    Join Date
    08-02-2012
    Location
    Sweden
    MS-Off Ver
    Office 2010
    Posts
    5

    Re: Exclude blank/FALSE cells in in Excel array IF formula output

    Hi all,

    I have uploaded a file explaining part 1. Link should work for 24h atleast.

    http://fildump.se/?file=tmp_19967203...y_problem.xlsx

    Hope you can help!

    Edit: will attach in the future. Your forum is mistakenly blocked in my office so I had to provide a link through my cell. Will fix it tonight from home
    Last edited by sushix; 03-08-2013 at 11:15 AM.

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,444

    Re: Exclude blank/FALSE cells in in Excel array IF formula output

    As connecting to external links could be unsafe, please attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

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

    View Pic

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

    Re: Exclude blank/FALSE cells in in Excel array IF formula output

    It would be easier here to use an array formula in F2 which can be copied down rather than an array entered in a range - is that an option for you? For example this formula in F2

    =IFERROR(INDEX(B$2:C$1333,SMALL(IF((MONTH(A$2:$A$1333)=I$3)*(YEAR(A$2:A$1333)=I$2),ROW(A$2:$A$1333)-ROW(A$2)+1),ROWS(F$2:F2)),MATCH(I$4,B$1:C$1,0)),"")

    confirmed with CTRL+SHIFT+ENTER and copied down - that will show values continuously from F2 then blanks once those run out
    Audere est facere

  8. #8
    Registered User
    Join Date
    08-02-2012
    Location
    Sweden
    MS-Off Ver
    Office 2010
    Posts
    5

    Re: Exclude blank/FALSE cells in in Excel array IF formula output

    Thanks, it's a step on the way but no exactly what i need. The reason why I want it to expand to a range is that I want to be able to run min/max/averages on it too (ie full formula in one cell).

    Is it possible?

    Another thing is that if I set January 2008 and series B, it will skip the #n/a but also fail to include cells b18:b22

    Let me know

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

    Re: Exclude blank/FALSE cells in in Excel array IF formula output

    Are you listing out the values in order to get the MIN/MAX/AVERAGE? If so then you don't really need to - you can calculate all of those with formulas directly, e.g. for MIN, excluding any error values

    =MIN(IF(MONTH(A2:A1333)=I3,IF(YEAR(A2:A1333)=I2,IF(B$1:C$1=I4,IF(ISNUMBER(B2:C1333),B2:C1333)))))

    confirm with CTRL+SHIFT+ENTER

    You can replace MIN with MAX and/or AVERAGE

  10. #10
    Registered User
    Join Date
    08-02-2012
    Location
    Sweden
    MS-Off Ver
    Office 2010
    Posts
    5

    Re: Exclude blank/FALSE cells in in Excel array IF formula output

    I think that does the trick for te avg min etc. Will let you know soon. Still, the array constructed list would be of interest. Just can't wrap my head around it

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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