Przejdź do głównej zawartości

Jak wyodrębnić wszystkie rekordy między dwiema datami w programie Excel?

Oto szereg danych w programie Excel, w tym przypadku chcę wyodrębnić wszystkie rekordy wierszy między dwiema datami, jak pokazano na poniższym zrzucie ekranu, czy masz jakieś pomysły, aby szybko obsłużyć to zadanie bez szukania danych i wyodrębniania ich ręcznie jeden po drugim?

wyciąg rekordu doc ​​między datami 1 strzałka w prawo wyciąg rekordu doc ​​między datami 2

Wyodrębnij wszystkie rekordy między dwiema datami za pomocą formuł

Wyodrębnij wszystkie rekordy między dwiema datami przez Kutools for Exceldobry pomysł 3


Wyodrębnij wszystkie rekordy między dwiema datami za pomocą formuł

Aby wyodrębnić wszystkie rekordy między dwiema datami w programie Excel, musisz wykonać następujące czynności:

1. Utwórz nowy arkusz, Arkusz2, i wpisz datę początkową i końcową w dwóch komórkach, na przykład A1 i B1. Zobacz zrzut ekranu:
wyciąg rekordu doc ​​między datami 3

2. W C1 w Sheet2 wpisz tę formułę, =SUMPRODUCT((Sheet1!$A$2:$A$22>=A2)*(Sheet1!$A$2:$A$22<=B2)), naciśnij Wchodzę klucz, aby policzyć całkowitą liczbę pasujących wierszy. Zobacz zrzut ekranu:
wyciąg rekordu doc ​​między datami 4

Uwaga: w formule Arkusz1 to arkusz zawierający oryginalne dane, z których chcesz wyodrębnić, 2 AUD 22: 2 USD to zakres danych, A2 i BXNUMX to data rozpoczęcia i data zakończenia.

3. Wybierz pustą komórkę, w której chcesz umieścić wyodrębnione dane, wpisz tę formułę =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)))), naciśnij Shift + Ctrl + Enter klucze i przeciągnij uchwyt automatycznego wypełniania na kolumny i wiersze, aby wyodrębnić wszystkie dane, aż pojawią się puste komórki lub wartości zerowe. Zobacz zrzut ekranu:
wyciąg rekordu doc ​​między datami 5

4. Usuń zera i wybierz daty wyświetlane jako 5-cyfrowe liczby, przejdź do Strona główna Zakładka i wybierz Krótka randka na liście rozwijanej Ogólne, aby sformatować je w formacie daty. Zobacz zrzut ekranu:
wyciąg rekordu doc ​​między datami 6


Wyodrębnij wszystkie rekordy między dwiema datami przez Kutools for Excel

Jeśli chcesz łatwiej obsługiwać tę pracę, możesz wypróbować funkcję Wybierz określone komórki w Kutools for Excel.

Po zainstalowaniu Kutools dla programu Excel, wykonaj poniższe czynności:(Bezpłatne pobieranie Kutools dla programu Excel teraz!)

1. Wybierz dane, z których chcesz wyodrębnić, kliknij Kutools > Wybierz > Wybierz określone komórki. Zobacz zrzut ekranu:
wyciąg rekordu doc ​​między datami 7

2. w Wybierz określone komórki okno dialogowe, sprawdź Cały rząd wybierz opcję i wybierz Lepszy niż i Mniej niż z list rozwijanych wpisz datę rozpoczęcia i datę zakończenia w polach tekstowych, pamiętaj o zaznaczeniu oraz. Zobacz zrzut ekranu:
wyciąg rekordu doc ​​między datami 8

3. kliknij Ok > OK. Wybrano wiersze zgodne z datami. naciśnij Ctrl + C aby skopiować wiersze, wybierz pustą komórkę i naciśnij Ctrl + V aby go wkleić, zobacz zrzut ekranu:
wyciąg rekordu doc ​​między datami 9

Najlepsze narzędzia biurowe

🤖 Pomocnik AI Kutools: Zrewolucjonizuj analizę danych w oparciu o: Inteligentne wykonanie   |  Wygeneruj kod  |  Twórz niestandardowe formuły  |  Analizuj dane i generuj wykresy  |  Wywołaj funkcje Kutools...
Popularne funkcje: Znajdź, wyróżnij lub zidentyfikuj duplikaty   |  Usuń puste wiersze   |  Łącz kolumny lub komórki bez utraty danych   |   Okrągły bez wzoru ...
Super wyszukiwanie: Wiele kryteriów VLookup    Wiele wartości VLookup  |   Przeglądanie pionowe na wielu arkuszach   |   Wyszukiwanie rozmyte ....
Zaawansowana lista rozwijana: Szybko twórz listę rozwijaną   |  Zależna lista rozwijana   |  Lista rozwijana wielokrotnego wyboru ....
Menedżer kolumn: Dodaj określoną liczbę kolumn  |  Przesuń kolumny  |  Przełącz stan widoczności ukrytych kolumn  |  Porównaj zakresy i kolumny ...
Polecane funkcje: Fokus siatki   |  Widok projektu   |   Duży pasek formuły    Menedżer skoroszytów i arkuszy   |  Biblioteka zasobów (Automatyczny tekst)   |  Selektor dat   |  Połącz arkusze   |  Szyfruj/odszyfruj komórki    Wysyłaj e-maile według listy   |  Super filtr   |   Specjalny filtr (filtruj pogrubienie/kursywa/przekreślenie...) ...
15 najlepszych zestawów narzędzi12 Tekst Tools (Dodaj tekst, Usuń znaki, ...)   |   50 + Wykres rodzaje (Wykres Gantta, ...)   |   40+ Praktyczne Wzory (Oblicz wiek na podstawie urodzin, ...)   |   19 Wprowadzenie Tools (Wstaw kod QR, Wstaw obraz ze ścieżki, ...)   |   12 Konwersja Tools (Liczby na słowa, Przeliczanie walut, ...)   |   7 Połącz i podziel Tools (Zaawansowane wiersze łączenia, Podział komórki, ...)   |   ... i więcej

Zwiększ swoje umiejętności Excela dzięki Kutools for Excel i doświadcz wydajności jak nigdy dotąd. Kutools dla programu Excel oferuje ponad 300 zaawansowanych funkcji zwiększających produktywność i oszczędzających czas.  Kliknij tutaj, aby uzyskać funkcję, której najbardziej potrzebujesz...

Opis


Karta Office wprowadza interfejs z zakładkami do pakietu Office i znacznie ułatwia pracę

  • Włącz edycję i czytanie na kartach w programach Word, Excel, PowerPoint, Publisher, Access, Visio i Project.
  • Otwieraj i twórz wiele dokumentów w nowych kartach tego samego okna, a nie w nowych oknach.
  • Zwiększa produktywność o 50% i redukuje setki kliknięć myszką każdego dnia!
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