+ Reply to Thread
Results 1 to 13 of 13

Close up empty rows after IF formula returns 'true' results

  1. #1
    Registered User
    Join Date
    12-02-2008
    Location
    Manila, The Philippines
    Posts
    22

    Close up empty rows after IF formula returns 'true' results

    In an Excel workbook I have a list of items in column A.

    I have labeled columns B, C, D, etc., as rooms in a building that the items in column A could go into.

    In the cells that intersect column A's listed items and each room's column I have placed the number of items I want in that room.

    On another worksheet I want to list the items each room will have. I have done this with the formula: =IF('Room Office Outfit'!C5>0,'Room Office Outfit'!$A5,"~").

    The problem is column A's list of items is over 200 and growing so, the summary list can have a few items listed then many lines of "~" before the next item shows. How can I close the summary lists to just show the items in successive lines?

    A secondary problem is that if I decide to remove an item from a room unless I 'Clear All' from the cell that I have left blank the item still appears in the list.

    I would rather solve this with formulas than macros.

    Thank you.
    Last edited by Cupsay; 01-31-2016 at 08:25 PM. Reason: clarify wording

  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: Close up empty rows after IF formula returns 'true' results

    Can you post a workbook with some sample data and a sample report that demonstrates the issue you want to resolve?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Close up empty rows after IF formula returns 'true' results

    Why don't you just use Autofilter on columns A, C, and whatever else you need?

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    12-02-2008
    Location
    Manila, The Philippines
    Posts
    22

    Re: Close up empty rows after IF formula returns 'true' results

    Thank you Ron & TMS for such quick responses.

    Ron attached is a very mini version of what I am doing.

    TMS I'm really pressed for time (deadline for this was the 16th of last month) and will have to look at filtering when I get the chance.

    Regards,
    Jon.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-02-2008
    Location
    Manila, The Philippines
    Posts
    22

    Re: Close up empty rows after IF formula returns 'true' results

    Oops, I just realized on the 'Room Item Summary' worksheet I forget to put the formulas to show the total items per room for rooms 2 to 6. No big thing as I have room 1 showing the totals of items per room.

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

    Re: Close up empty rows after IF formula returns 'true' results

    Which version of Excel are you using?

  7. #7
    Registered User
    Join Date
    12-02-2008
    Location
    Manila, The Philippines
    Posts
    22

    Re: Close up empty rows after IF formula returns 'true' results

    Hi Ron,

    Sorry, it's been so long since I used this site I forget to include such critical info - I'm using Excel 13 off a Windows 7 OS.

    To Trevor (a.k.a. TMS) - My apologies for calling you TMS, I only just noticed your name since my earlier reply to Ron and yourself.

    Regards,
    Jon.

  8. #8
    Registered User
    Join Date
    12-02-2008
    Location
    Manila, The Philippines
    Posts
    22

    Re: Close up empty rows after IF formula returns 'true' results

    Hi Forum Helpers...

    While looking through 'Similar Threads' in the box below (to make sure there wasn't a previous question like mine that had been solved) I saw a request for help by Hangman. I can't see how to link that plea to mine as I think the Forum Rules require me to - if I should have perhaps a Moderator will tell me how.

    I downloaded Hangman's worksheet and loaded into it a solution offered by Benishiryo (this array: =IFERROR(INDEX($B$2:$B$100,SMALL(IF($A$2:$A$100="Yes",ROW($A$2:$A$100)),ROWS(C$2:C2))-ROW($A$2)+1),"").

    It solved Hangman's problem and looks tantalizing close to being able to solve mine - except the criteria is 'Yes' or 'No' (not any number from 1 up like have) and it returns a number from another column whereas I need the text in a specified column to be returned. However, it does only show rows that meet the criteria and the list of results immediately increases or decreases as the criteria is changed from true to untrue. I'm not sure if this array can be adapted but, maybe it will suggest a solution.
    Last edited by Cupsay; 02-01-2016 at 03:06 AM. Reason: Correct spelling

  9. #9
    Registered User
    Join Date
    12-02-2008
    Location
    Manila, The Philippines
    Posts
    22

    Re: Close up empty rows after IF formula returns 'true' results SOLVED

    Not one to let the sand settle under my feet... while waiting around for someone to offer a solution, I ‘played’ around with the array
    I mentioned in my last post that was written by Benishiryo to solve another person's problem
    (this array: =IFERROR(INDEX($B$2:$B$100,SMALL(IF($A$2:$A$100="Yes",ROW($A$2:$A$100)),ROWS(C$2:C2))-ROW($A$2)+1),"").

    As a result I was able to solve my own problem by experimentation. I'm not sure what every element in the array is there for,
    I just know that I got it to do exactly what I needed. Essentially I had to add a few columns to satisfy the requirements of
    Benishiryo's array.

    I'm sure an Excel Expert reading this, and looking at the attached excel file of my solution, could possibly have achieved the same
    result much neater and without the extra steps/columns I have had to put in to make it work but, then again on the other hand, such
    an expert might never have offered a solution.

    For those who are looking for such a solution, it is for your benefit that I have peppered my workbook solution with comments in a
    hope that you find them helpful. On the summary worksheet the key array is used twice - once to give a closed up list of the number
    of items and in the next column to give a closed up list of these items. I found I didn't really need to understand exactly what
    every array element was there for, I just had to apply a little logic to get it to return what I wanted. Please enjoy.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    12-02-2008
    Location
    Manila, The Philippines
    Posts
    22

    Re: Close up empty rows after IF formula returns 'true' results

    Hi Trevor,

    You'll see I found my own solution by adapting another solution... but, to answer your suggestion about autofiltering, I haven't used it too much when using excel and even if I was very familiar with its use not everybody who will need to use this workbook are. The object was to set up a system whereby anybody in the team could go to the matrix worksheet and from the 'wishlist' of items available select what they would like in the room they will be working in (of the new complex we are building) merely by putting a number in the right cell. Because the wishlist is well over 400 items as of this moment, the idea of the summary worksheet was so they could see what others before them had selected and/or easily see what was missing that they would like.

    Thanks for responding... if you have time I'd be interested to hear from you regarding the solution I came to.

    BTW I'd like to mark this thread as solved but can't see how.

    Regards,
    Jon.

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Close up empty rows after IF formula returns 'true' results

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  12. #12
    Registered User
    Join Date
    12-02-2008
    Location
    Manila, The Philippines
    Posts
    22

    Re: Close up empty rows after IF formula returns 'true' results

    Dear Trevor,

    Thanks for letting me know how to mark it as solved - and I guess, as you didn't comment on the solution I came up with, it's about as good as I could get(?).

    The person due thanks is Benishiryo but, I got his formula array from another thread so, I'll go to that thread, leave him a thank you comment and when he replies tick his star... that way he might also find his way back to my use of his formula.

    Regards,
    Jon.

  13. #13
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Close up empty rows after IF formula returns 'true' results

    hi Jon. read your post from the thread you posted, but i was somehow unable to post in the thread these couple of weeks.

    from your Room Item Summary sheet, you can try this array formula in cell E12 to avoid the helper columns (if that is what you are looking for):
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    you can avoid the array in cell D12 by using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    you can copy the formulas down and across the other rooms.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

+ 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. Formula to Return Results without any Empty Rows
    By HangMan in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-08-2016, 04:36 AM
  2. Access Query, Checkbox returns all results that are not empty
    By ratdogexcel in forum Access Tables & Databases
    Replies: 1
    Last Post: 11-03-2014, 12:17 PM
  3. [SOLVED] Highlighting cell when IF formula returns TRUE value
    By Carrieolus in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-12-2014, 07:29 AM
  4. IF STATEMENT returns False, even though the results are true
    By Biolu527 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-28-2013, 11:21 AM
  5. [SOLVED] need formula that finds phone #, if true, returns empty cell
    By jessexcel in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-23-2013, 11:44 PM
  6. Replies: 14
    Last Post: 06-27-2012, 04:26 PM
  7. match formula always returns true response
    By jenpen in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-09-2009, 01:01 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