Hoppa till huvudinnehåll

Hur extraherar jag alla poster mellan två datum i Excel?

Här är en rad data i Excel, och i det här fallet vill jag extrahera alla raderposter mellan två datum som visas nedan, har du några idéer för att snabbt hantera det här jobbet utan att leta efter data och extrahera dem manuellt?

dokumentutdragspost mellan datum 1 skottpil höger dokumentutdragspost mellan datum 2

Extrahera alla poster mellan två datum med formler

Extrahera alla poster mellan två datum av Kutools för Excelbra idé3


Extrahera alla poster mellan två datum med formler

För att extrahera alla poster mellan två datum i Excel måste du göra så här:

1. Skapa ett nytt ark, Sheet2, och skriv startdatum och slutdatum i två celler, till exempel A1 och B1. Se skärmdump:
dokumentutdragspost mellan datum 3

2. Skriv denna formel i C1 i Sheet2, =SUMPRODUCT((Sheet1!$A$2:$A$22>=A2)*(Sheet1!$A$2:$A$22<=B2)), Tryck ange för att räkna det totala antalet matchande rader. Se skärmdump:
dokumentutdragspost mellan datum 4

Notera: i formeln är Sheet1 arket som innehåller originaldata du vill extrahera från, $ A $ 2: $ A $ 22 är dataområdet, A2 och B2 är startdatum och slutdatum.

3. Välj en tom cell som du ska placera den extraherade informationen, skriv denna formel =IF(ROWS(A$5:A5)>$C$2,"",INDEX(Sheet1!A$2:A$22,SMALL(IF((Sheet1!$A$2:$A$22>=$A$2)*(Sheet1!$A$2:$A$22<=$B$2),ROW(Sheet1!A$2:A$22)-ROW(Sheet1!$A$2)+1),ROWS(A$5:A5)))), Tryck Skift + Ctrl + Enter och dra automatiskt fylla handtaget över kolumner och rader för att extrahera all data tills tomma celler eller nollvärden visas. Se skärmdump:
dokumentutdragspost mellan datum 5

4. Ta bort nollorna och välj datum som visas som femsiffriga nummer, gå till Hem fliken och välj Kort datum i listrutan Allmänt för att formatera dem i datumformatering. Se skärmdump:
dokumentutdragspost mellan datum 6


Extrahera alla poster mellan två datum av Kutools för Excel

Om du lättare vill hantera det här jobbet kan du prova funktionen Välj specifika celler i Kutools för Excel.

Kutools för Excel, med mer än 300 praktiska funktioner, gör dina jobb enklare. 

När du har installerat Kutools för Excel, gör så här:(Gratis nedladdning Kutools för Excel nu!)

1. Välj de data du vill extrahera från, klicka på Kutools > Välja > Välj specifika celler. Se skärmdump:
dokumentutdragspost mellan datum 7

2. I Välj specifika celler dialogrutan, kontrollera Hela raden alternativ och välj Större än och Mindre än från rullgardinslistorna, skriv startdatum och slutdatum i textrutorna, kom ihåg att kontrollera Och. Se skärmdump:
dokumentutdragspost mellan datum 8

3. klick Ok > OK. Och raderna som matchade datumen har valts. Tryck Ctrl + C för att kopiera raderna och välj en tom cell och tryck på Ctrl + V för att klistra in den, se skärmdump:
dokumentutdragspost mellan datum 9

Bästa kontorsproduktivitetsverktyg

🤖 Kutools AI Aide: Revolutionera dataanalys baserat på: Intelligent utförande   |  Generera kod  |  Skapa anpassade formler  |  Analysera data och generera diagram  |  Anropa Kutools funktioner.
Populära funktioner: Hitta, markera eller identifiera dubbletter   |  Ta bort tomma rader   |  Kombinera kolumner eller celler utan att förlora data   |   Rund utan formel ...
Superuppslag: Flera kriterier VLookup    VLookup med flera värden  |   VSök över flera ark   |   Fuzzy Lookup ....
Avancerad rullgardinslista: Skapa snabbt en rullgardinslista   |  Beroende rullgardinslista   |  Flervals-rullgardinslista ....
Kolumnhanterare: Lägg till ett specifikt antal kolumner  |  Flytta kolumner  |  Växla synlighetsstatus för dolda kolumner  |  Jämför intervall och kolumner ...
Utvalda funktioner: Rutnätsfokus   |  Designvy   |   Stor formelbar    Arbetsbok & Bladhanterare   |  Resursbibliotek (Automatisk text)   |  Datumväljare   |  Kombinera arbetsblad   |  Kryptera/Dekryptera celler    Skicka e-postmeddelanden efter lista   |  Superfilter   |   Specialfilter (filtrera fet/kursiv/genomstruken...) ...
Topp 15 verktygssatser12 text verktyg (lägga till text, Ta bort tecken, ...)   |   50+ Diagram Typer (Gantt Chart, ...)   |   40+ Praktiskt Formler (Beräkna ålder baserat på födelsedag, ...)   |   19 Införande verktyg (Infoga QR-kod, Infoga bild från sökväg, ...)   |   12 Konvertering verktyg (Siffror till ord, Valutaväxling, ...)   |   7 Slå ihop och dela verktyg (Avancerade kombinera rader, Dela celler, ...)   |   ... och mer

Uppgradera dina Excel-färdigheter med Kutools för Excel och upplev effektivitet som aldrig förr. Kutools för Excel erbjuder över 300 avancerade funktioner för att öka produktiviteten och spara tid.  Klicka här för att få den funktion du behöver mest...

Beskrivning


Fliken Office ger ett flikgränssnitt till Office och gör ditt arbete mycket enklare

  • Aktivera flikredigering och läsning i Word, Excel, PowerPoint, Publisher, Access, Visio och Project.
  • Öppna och skapa flera dokument i nya flikar i samma fönster, snarare än i nya fönster.
  • Ökar din produktivitet med 50 % och minskar hundratals musklick för dig varje dag!
Comments (19)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi, this formula worked ok, except it only returned one data set for each date in the range. Is there an adjustment to allow for multiple entries with the dame date value?
This comment was minimized by the moderator on the site
This formula works awesome thanks, I need some extra help though. I have 200 employees, each with certification that expires on different dates. The heading for each certification is at the top with their expiry dates below. I want to extract the rows that with all info if there is an expiry reached and throw them into a new sheet. Exactly like the example above just dated from multiple columns.
This comment was minimized by the moderator on the site
Hi, Christiaan82, could you upload the a screenshot about you workhsheet, or give me more details about the information of sheet format, only with your description, I do not get it clearly.
This comment was minimized by the moderator on the site
All sorted. Instead of trying to retrieve the rows from multiple columns, I added a new hidden sheet where all the info populates the info on top of each other. So the information only needs to be retrieved from one column, as per your example above.
Thank you Sunny
This comment was minimized by the moderator on the site
"drag Auto fill handle over columns and rows to extract all data until blank cells or zero values appear."
This doesn't seem to be working for me. The first row gives me the dates but the same gets repeated in the next two rows.
This comment was minimized by the moderator on the site
Hi, Neha, could you check if your auto calculate is turn on? Click Formulas > Calcuations Options > Automatic.
This comment was minimized by the moderator on the site
it worked well for single sheet. can u pls help me to get the same from multiple sheets of similar data. first 4 sheets contain similar data. i need all records of same 'date' in sheet5.
This comment was minimized by the moderator on the site
Can you extend the formula to check for dates that encompass more than one day? For example, using the same start and end dates from 1/1/15-12/31/16, but the data in sheet 1 have start and end dates too rather than just existing for a singular date.
This comment was minimized by the moderator on the site
This formula worked brilliantly. I was concerned as I have multiple date duplicates and there was no mention of how it handles those; no issues. It returned all relevant data.
Stoked.
This comment was minimized by the moderator on the site
Thanks for your support, you can combined the duplicate dates cells after extracting.
This comment was minimized by the moderator on the site
The trouble I am having because I need to find dates that run through the date range specified. So I want anything that runs through something like 1/2016 to 12/2017, however it needs to include start dates that may be before the range so I can identify the records I need to look at.
This comment was minimized by the moderator on the site
I used this code and it is pulling up dates outside of the window... how do I fix it?
This comment was minimized by the moderator on the site
Which code Kayla? Do you mean the formula?
This comment was minimized by the moderator on the site
I recreated this example in Excel 2010, and the result was that the first row of data would show up, but everything underneath had a number error.
This comment was minimized by the moderator on the site
Same thing happens to me n Excel 2010. Something in the formula doesn't work correctly.
This comment was minimized by the moderator on the site
Have you pressed Shift + Ctrl + Enter keys?
This comment was minimized by the moderator on the site
I see what's wrong. You have to press the shift + CTRL + Enter keys while still in edit mode.
I was hitting those keys after entering the formula and hitting ENTER.
I wish it would have been clearer.
This comment was minimized by the moderator on the site
Yes, brian, after typing the formula and still in edit mode, directly press Shift + Ctrl + Enter keys (the keys instead of Enter key), to get the correct result.
This comment was minimized by the moderator on the site
Still doesnt work for me? I am doing exactly as above and still returning the NUM error? Any other ideas?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations