मुख्य सामग्री पर जाएं

Excel में दिनांक दर्ज करने या बदलने पर दिनांक को स्वचालित रूप से कैसे क्रमबद्ध करें? 

लेखक: ज़ियाओयांग अंतिम संशोधित: 2020-12-25

एक्सेल में, तरह फ़ंक्शन आपकी आवश्यकता के अनुसार दिनांक को आरोही या अवरोही क्रम में क्रमबद्ध करने में आपकी सहायता कर सकता है। लेकिन यह गतिशील नहीं है, यदि आपने तारीख को क्रमबद्ध कर लिया है और फिर उसमें नई तारीख जोड़ दी है, तो आपको इसे फिर से क्रमबद्ध करने की आवश्यकता होगी। क्या वर्कशीट में हर बार नई तारीख दर्ज करते समय तारीख को स्वचालित रूप से क्रमबद्ध करने का कोई अच्छा और त्वरित तरीका है?

जब दिनांक दर्ज किया जाता है या सूत्र के साथ बदला जाता है तो दिनांक स्वतः क्रमबद्ध होता है

जब तारीख दर्ज की जाती है या वीबीए कोड के साथ बदली जाती है तो तारीख को स्वचालित रूप से क्रमबद्ध करें


तीर नीला दायां बुलबुला जब दिनांक दर्ज किया जाता है या सूत्र के साथ बदला जाता है तो दिनांक स्वतः क्रमबद्ध होता है

उदाहरण के लिए, कॉलम ए में मूल तिथि, निम्नलिखित सूत्र आपको उस कॉलम के आधार पर नए सहायक कॉलम में दिनांक या किसी अन्य टेक्स्ट स्ट्रिंग को स्वचालित रूप से सॉर्ट करने में मदद कर सकता है जिसे आप सॉर्ट करना चाहते हैं, कृपया निम्नानुसार करें:

1. यह सूत्र दर्ज करें:

=INDEX($A$2:$A$15,MATCH(ROWS($A$2:A2),COUNTIF($A$2:$A$15,"<="&$A$2:$A$15),0)) आपके दिनांक कॉलम के बगल में एक रिक्त कक्ष में, C2, उदाहरण के लिए, और फिर दबाएँ Ctrl + Shift + Enter कुंजियाँ एक साथ, और आपको एक संख्या अनुक्रम मिलेगा, फिर भरण हैंडल को उन कक्षों तक खींचें जिनका आप उपयोग करना चाहते हैं, स्क्रीनशॉट देखें:

नोट: उपरोक्त सूत्र में: A2: A15 यह आपकी मूल दिनांक सीमा है जिसे आप स्वतः क्रमित करना चाहते हैं।

दिनांक 1 के अनुसार दस्तावेज़ स्वतः क्रमबद्ध करें

2. फिर क्लिक करके संख्याओं को दिनांक प्रारूप के रूप में प्रारूपित करें कम समय से सामान्य जानकारी के अंतर्गत ड्रॉप डाउन सूची होम टैब, स्क्रीनशॉट देखें:

दिनांक 2 के अनुसार दस्तावेज़ स्वतः क्रमबद्ध करें

3. फिर अनुक्रम संख्याओं को दिनांक प्रारूप में परिवर्तित कर दिया गया है, और मूल तिथि को भी क्रमबद्ध कर दिया गया है, स्क्रीनशॉट देखें:

दिनांक 3 के अनुसार दस्तावेज़ स्वतः क्रमबद्ध करें

4. अब से, जब आप नई तारीख दर्ज करते हैं या कॉलम ए में तारीख बदलते हैं, तो कॉलम सी में तारीख स्वचालित रूप से आरोही क्रम में क्रमबद्ध हो जाएगी, स्क्रीनशॉट देखें:

दिनांक 4 के अनुसार दस्तावेज़ स्वतः क्रमबद्ध करें


तीर नीला दायां बुलबुला जब तारीख दर्ज की जाती है या वीबीए कोड के साथ बदली जाती है तो तारीख को स्वचालित रूप से क्रमबद्ध करें

जब आप नई तारीख दर्ज करते हैं या अपनी आवश्यकता के अनुसार तारीख बदलते हैं तो निम्नलिखित वीबीए कोड आपको मूल कॉलम में तारीख को स्वचालित रूप से क्रमबद्ध करने में मदद कर सकता है।

1. उस वर्कशीट पर जाएं जिसे आप दिनांक दर्ज करते समय या बदलते समय स्वचालित रूप से दिनांक को क्रमबद्ध करना चाहते हैं।

2. शीट टैब पर राइट क्लिक करें और चयन करें कोड देखें संदर्भ मेनू से, पॉप आउट में अनुप्रयोगों के लिए माइक्रोसॉफ्ट विज़ुअल बेसिक विंडो, कृपया निम्नलिखित कोड को कॉपी करें और रिक्त स्थान पर चिपकाएँ मॉड्यूल विंडो, स्क्रीनशॉट देखें:

वीबीए कोड: तारीख दर्ज करने या बदलने पर ऑटो सॉर्ट:

Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice
    On Error Resume Next
    If Application.Intersect(Target, Application.Columns(1)) Is Nothing Then Exit Sub
    If Target.Count > 1 Then Exit Sub
    Range("A1").Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlYes, _
                                        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub

दिनांक 6 के अनुसार दस्तावेज़ स्वतः क्रमबद्ध करें

नोट: उपरोक्त कोड में, दर्ज की गई तारीख कॉलम ए में ऑटो सॉर्ट हो जाएगी, आप बदल सकते हैं A1 और A2 अपनी स्वयं की कोशिकाओं में, जैसी आपको आवश्यकता हो।

3. अब से, जब आप कॉलम ए में तारीख दर्ज करेंगे, तो तारीख स्वचालित रूप से बढ़ते हुए क्रमबद्ध हो जाएगी।

सर्वोत्तम कार्यालय उत्पादकता उपकरण

🤖 कुटूल्स एआई सहयोगी: निम्न के आधार पर डेटा विश्लेषण में क्रांति लाएं: बुद्धिमान निष्पादन   |  कोड जनरेट करें  |  कस्टम फ़ॉर्मूले बनाएं  |  डेटा का विश्लेषण करें और चार्ट बनाएं  |  कुटूल फ़ंक्शंस का आह्वान करें...
लोकप्रिय सुविधाएँ: डुप्लिकेट ढूंढें, हाइलाइट करें या पहचानें   |  रिक्त पंक्तियाँ हटाएँ   |  डेटा खोए बिना कॉलम या सेल को संयोजित करें   |   फॉर्मूला के बिना गोल ...
सुपर लुकअप: एकाधिक मानदंड VLookup    मल्टीपल वैल्यू वीलुकअप  |   अनेक शीटों में VLookup   |   फजी लुकअप ....
उन्नत ड्रॉप-डाउन सूची: शीघ्रता से ड्रॉप डाउन सूची बनाएं   |  आश्रित ड्रॉप डाउन सूची   |  बहु-चयन ड्रॉप डाउन सूची ....
स्तम्भ प्रबंधक: कॉलमों की एक विशिष्ट संख्या जोड़ें  |  कॉलम ले जाएँ  |  छिपे हुए कॉलम की दृश्यता स्थिति टॉगल करें  |  रेंज और कॉलम की तुलना करें ...
फीचर्ड फीचर्स: ग्रिड फोकस   |  डिजाइन देखें   |   बड़ा फॉर्मूला बार    कार्यपुस्तिका एवं शीट प्रबंधक   |  संसाधन लाइब्रेरी (ऑटो टेक्स्ट)   |  खजूर बीनने वाला   |  कार्यपत्रकों को संयोजित करें   |  एन्क्रिप्ट/डिक्रिप्ट सेल    सूची के अनुसार ईमेल भेजें   |  सुपर फ़िल्टर   |   विशेष फ़िल्टर (फ़िल्टर बोल्ड/इटैलिक/स्ट्राइकथ्रू...) ...
शीर्ष 15 टूलसेट12 टेक्स्ट टूल्स (पाठ जोड़ें, अक्षर हटाएँ, ...)   |   50 + चार्ट प्रकार (गैन्ट चार्ट, ...)   |   40+ प्रैक्टिकल सूत्र (जन्मदिन के आधार पर आयु की गणना करें, ...)   |   19 निवेशन टूल्स (QR कोड डालें, पथ से चित्र सम्मिलित करें, ...)   |   12 रूपांतरण टूल्स (शब्दों को संख्याएँ, मुद्रा रूपांतरण, ...)   |   7 विलय और विभाजन टूल्स (उन्नत संयोजन पंक्तियाँ, विभाजन कोशिकाओं, ...)   |   ... और अधिक

एक्सेल के लिए कुटूल के साथ अपने एक्सेल कौशल को सुपरचार्ज करें, और पहले जैसी दक्षता का अनुभव करें। एक्सेल के लिए कुटूल उत्पादकता बढ़ाने और समय बचाने के लिए 300 से अधिक उन्नत सुविधाएँ प्रदान करता है।  वह सुविधा प्राप्त करने के लिए यहां क्लिक करें जिसकी आपको सबसे अधिक आवश्यकता है...

Description


ऑफिस टैब ऑफिस में टैब्ड इंटरफ़ेस लाता है, और आपके काम को बहुत आसान बनाता है

  • Word, Excel, PowerPoint में टैब्ड संपादन और रीडिंग सक्षम करें, प्रकाशक, एक्सेस, विसियो और प्रोजेक्ट।
  • नई विंडो के बजाय एक ही विंडो के नए टैब में एकाधिक दस्तावेज़ खोलें और बनाएं।
  • आपकी उत्पादकता 50% बढ़ जाती है, और आपके लिए हर दिन सैकड़ों माउस क्लिक कम हो जाते हैं!
Comments (15)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hello,This is a great tool. thank you. How can i apply this to multiple columns in the same tab? Could i apply it to restart sorting by date in a new cell of the same column? Would i just repaste the VBA code into the same window?
Thank you.
This comment was minimized by the moderator on the site
Hello Noname9,How are you? To achieve your goal by using VBA code is beyond my reach. But I do know how to use formulas to do the trick.Suppose we have two columns of dates, say A2:B7. How to sort these dates into a new column? Please do as follows.
First, we need to combine the two columns of dates into one column. Copy and paste the formula =INDEX($A$2:$B$7,INT((ROWS(D$2:D2)-1)/2)+1,MOD(ROWS(D$2:D2)-1,2)+1) into cell D2. And drag the fill handle down to combine all dates. Please see screenshot 1.
Then, we will sort the combined dates. Copy and paste the formula =INDEX($D$2:$D$13,MATCH(ROWS($D$2:D2),COUNTIF($D$2:$D$13,"<="&$D$2:$D$13),0)) into F2. And drag the fill handle down to sort all dates. Please see screenshot 2.
Hope it will help. Have a nice day.Sincerely,Mandy
This comment was minimized by the moderator on the site
Hello,What if i want to do this to multiple columns or even have anew start point in the same column? Do i just do a break and recopy the VBA code in that same window?
Thank you.
This comment was minimized by the moderator on the site
That VBA code is solid gold! Thank you! :-)
This comment was minimized by the moderator on the site
With the VBA code, I have copy and pasted the above but wish for the dates in column F to be the values by which the data is sorted. I've changed the range values to F2 and F3500 (the size of the spreadsheet where row 1 is titles), but it still sorts by the dates in column A. Can somebody help me please?
This comment was minimized by the moderator on the site
Hello, Ross,
When applying the code to column F, you should change some references to your need as below code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice 20160606
On Error Resume Next
If Application.Intersect(Target, Application.Columns(6)) Is Nothing Then Exit Sub
If Target.Count > 1 Then Exit Sub
Range("F1").Sort Key1:=Range("F2"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub

Please try, hope it can help you!
This comment was minimized by the moderator on the site
Is there a particular formula to keep the cells following the sorted date? It would be nice to organize by date but keep the entire row of information. Any help would be much appreciated.
This comment was minimized by the moderator on the site
I mad a checkbook register and it works but I want to figure out how to make my entry’s to go into date order. Any help would be appreciated. I’m still learning excel.
This comment was minimized by the moderator on the site
In addition to the duplicate dates, is there also a way to include multiple columns of data when it sorts? I need it to include multiple columns and sort them all together with the expiration dates.
This comment was minimized by the moderator on the site
how can I do this same sorting calculation but from newest date to oldest? Currently it is Oldest to Newest. Flipping the < sign isn't enough and beyond that I don't have a strong enough understanding of what it is doing. Also I think what may be happening is excel automatically works top to bottom causing difficulties.
This comment was minimized by the moderator on the site
Hello, Bo,

To auto sort the date from newest to oldest, you just need to change the <= to >= in the above formula as follows:
=INDEX($A$2:$A$15,MATCH(ROWS($A$2:A2),COUNTIF($A$2:$A$15,">="&$A$2:$A$15),0))
After inserting this formula, please remember to press Ctrl + Shift + Enter keys together to get the correct result.
Please try it.
This comment was minimized by the moderator on the site
What if there is a duplicate date in the list? And I want both numbers to show up.
This comment was minimized by the moderator on the site
Hello, Ryan,

To sort the date with duplicate ones, you should apply the following formula:

=IFERROR(INDEX($A$2:$A$11,MATCH(ROWS($A$2:A2),COUNTIF($A$2:$A$11,"<="&$A$2:$A$11),0)),IF(ROWS($A$2:A2)<ROWS($A$2:$A$11),B3,""))

Please remember to press Shift + Ctrl + Enter keys together.

Hope it can help you, thank you!
This comment was minimized by the moderator on the site
Awesome :) Working fine
This comment was minimized by the moderator on the site
U forgot to mention the formula is array and you need to ctrl+Shift+ enter. Luckily you had a screenshot or your page would be a waste of cyberspace
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations