+ Reply to Thread
Results 1 to 8 of 8

How to remove blank lines from VLookup or IF statement spreadsheet

  1. #1
    Registered User
    Join Date
    01-23-2015
    Location
    Washington
    MS-Off Ver
    2010
    Posts
    4

    How to remove blank lines from VLookup or IF statement spreadsheet

    I have a workbook that has a worksheet that contains information for many individuals from different towns. I am trying to set up individual worksheets within the workbook for each town. On the individual worksheet, I want to list all information for the individual from the main worksheet. My question is, I can use VLookup or IF statements to get the information over but it creates blank lines. How do I get these blank lines to not be there. I know this would be better in Access and that I can use a quick filter on my main sheet but I would like to see if I can get Excel to do this.

    Thank you for you help
    Last edited by mkinsman; 01-26-2015 at 11:37 AM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How to remove blank lines from VLookup or IF statement spreadsheet

    Let's say the town is in column F of sheet 1 starting at F2 and your last column of data is G

    In H2 of sheet1
    =F2 &"_"&COUNTIF($F$2:$F2, F2)
    copied down the sheet

    Let's say sheet2 is for Turnipville and you want all the same columns but just the ones for Turnipville
    In A2
    =INDEX(Sheet1!A$2:A$100, MATCH("Turnipville_"&ROWS($A$1:$A1), Sheet1!$H$2:$H$100,0))
    copied down.
    might be easier to follow if you uploaded an example (Go Advanced>Manage Attachments)
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

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

  3. #3
    Registered User
    Join Date
    01-23-2015
    Location
    Washington
    MS-Off Ver
    2010
    Posts
    4

    Re: How to remove blank lines from VLookup or IF statement spreadsheet

    Thank you. I will try to upload it in a minute. One question on the second formula. Why do you use !A$2:A$100 from sheet 1?

    Workbook should be attached.Attachment 372527
    Attached Files Attached Files
    Last edited by mkinsman; 01-23-2015 at 05:58 PM.

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to remove blank lines from VLookup or IF statement spreadsheet

    Try this array formula. in A4 and pull formula to the very right and then down

    =IFERROR(INDEX(Summary!A$2:A$19,SMALL(IF(Summary!$A$2:$A$19<>"",ROW(Summary!A$2:A$19)-ROW($A$2)+1),ROWS(A$1:A1))),"")
    Attached Files Attached Files
    Last edited by AlKey; 01-23-2015 at 07:12 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Registered User
    Join Date
    01-23-2015
    Location
    Washington
    MS-Off Ver
    2010
    Posts
    4

    Re: How to remove blank lines from VLookup or IF statement spreadsheet

    Thank you AlKey but that gives me all people on the Turnipville sheet (even those from Waterville) and all I want to show are the people from Turnipville.

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to remove blank lines from VLookup or IF statement spreadsheet

    Sorry, I din't see this mentioned anywhere. Here is an adjusted formula

    =IFERROR(INDEX(Summary!A$2:A$19,SMALL(IF((Summary!$A$2:$A$19="Turnipville")*(Summary!$A$2:$A$19<>""),ROW(Summary!A$2:A$19)-ROW($A$2)+1),ROWS(A$1:A1))),"")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-23-2015
    Location
    Washington
    MS-Off Ver
    2010
    Posts
    4

    Re: How to remove blank lines from VLookup or IF statement spreadsheet

    Thank you. That worked!

    I appreciate your help.

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to remove blank lines from VLookup or IF statement spreadsheet

    You're welcome. Don't forget to thank those who helped by clicking on Add Reputation * and please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools-> Mark thread as Solved).

+ 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. Remove dotted lines on spreadsheet
    By Vermilion in forum Excel General
    Replies: 5
    Last Post: 04-19-2012, 09:25 AM
  2. Remove Blank Lines
    By Robotacha2010 in forum Excel General
    Replies: 5
    Last Post: 08-16-2010, 11:59 AM
  3. [SOLVED] Remove lines from spreadsheet that have the value 0
    By ZorroZ in forum Excel General
    Replies: 2
    Last Post: 10-27-2009, 08:17 PM
  4. [SOLVED] Remove Blank Lines
    By Nigel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2005, 11:00 AM
  5. [SOLVED] remove blank lines from an entire spreadsheet
    By mdeanda in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-21-2005, 09:06 AM

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