+ Reply to Thread
Results 1 to 5 of 5

How to pull in entire line of data based on being between two date without skipping lines

  1. #1
    Registered User
    Join Date
    06-28-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    22

    How to pull in entire line of data based on being between two date without skipping lines

    I have a spreadsheet with rows # 1 to 30. On a separate tab I have data with headers. The data will be copy and pasted into the document with the same headers. I want to pull in the full line of each invoice into the invoice tab, but only if the date on it is after or on the start date that will be inputted into c2 and on or less than the end date that will be in c3. That date will change, which is why I have it as an input cell. Is there anyway to do this without skipping lines? I cannot figure out how to do it without it giving me blanks when the date isn't on or after.

    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: How to pull in entire line of data based on being between two date without skipping li

    See that attached revised file. I think it should do what you want it to do.

    Cell B7 uses this ARRAY formula (entered with Ctrl + Shift + Enter):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Cell C7 uses this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Cell D7 uses this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Cell E7 uses this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Then fill those down all 30 rows. Hope it helps!

    - Moo
    Attached Files Attached Files
    Last edited by Moo the Dog; 01-11-2019 at 02:17 PM.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: How to pull in entire line of data based on being between two date without skipping li

    You could put this formula in a helper column on the Data Upload sheet (I used cell G2):

    =IF(AND(B2<>"",B2>=Invoice!$C$2,B2<=Invoice!$C$3),MAX(G$1:G1)+1,"-")

    Copy this down to the bottom of your data (or below, if you want to accommodate new data being added). Then you can use this formula in B7 of the Invoice sheet:

    =IFERROR(INDEX('Date Upload'!$A:$E,MATCH(ROWS($1:1),'Date Upload'!$G:$G,0),MATCH(B$6,'Date Upload'!$A$1:$E$1,0)),"")

    Copy this across into C7:E7, format D7 and E7 in the style you prefer, then copy the 4 formulae down as far as you like.

    Then put some dates in C2 and C3 and the data will automatically be displayed.

    Hope this helps.

    Pete

    EDIT: working file attached
    Attached Files Attached Files
    Last edited by Pete_UK; 01-11-2019 at 02:30 PM.

  4. #4
    Registered User
    Join Date
    06-28-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    22

    Re: How to pull in entire line of data based on being between two date without skipping li

    Thank you both! I used both methods and they did exactly what they wanted. I'm going to play around with it some and figure out which one to use. Thanks again for both of your help!

  5. #5
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: How to pull in entire line of data based on being between two date without skipping li

    Glad to hear it! Have a great day.

    - Moo

+ 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. Replies: 3
    Last Post: 12-28-2018, 05:01 PM
  2. Replies: 2
    Last Post: 12-07-2016, 12:39 PM
  3. Replies: 1
    Last Post: 12-06-2016, 06:16 PM
  4. Replies: 2
    Last Post: 11-07-2016, 11:33 AM
  5. Exporting data - skipping lines macro
    By guibro in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-26-2015, 06:17 AM
  6. [SOLVED] Export in other sheet , loop (skipping lines in between) and populating data
    By guibro in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-18-2015, 08:19 AM
  7. [SOLVED] Remove lines based on cell value (remove lines in range, not entire row)
    By Tapyr in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-27-2015, 07:31 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