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

एक्सेल में मानदंड के आधार पर टेक्स्ट को आसानी से कैसे संयोजित करें?

लेखक: ज़ियाओयांग अंतिम संशोधित: 2021-01-06

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

दस्तावेज़ मानदंड 1 के आधार पर पाठ को संयोजित करें

उपयोगकर्ता परिभाषित फ़ंक्शन के साथ मानदंड के आधार पर पाठ को संयोजित करें

Excel के लिए कुटूल के साथ मानदंड के आधार पर पाठ को संयोजित करें


टेक्स्ट को अद्वितीय आईडी नंबरों के साथ संयोजित करने के लिए, आप पहले अद्वितीय मान निकाल सकते हैं और फिर अद्वितीय आईडी के आधार पर नामों को संयोजित करने के लिए एक उपयोगकर्ता परिभाषित फ़ंक्शन बना सकते हैं।

1. उदाहरण के तौर पर निम्नलिखित डेटा लें, आपको पहले विशिष्ट आईडी नंबर निकालने होंगे, कृपया इस सरणी सूत्र को लागू करें: =IFERROR(INDEX($A$2:$A$15, MATCH(0,COUNTIF($D$1:D1, $A$2:$A$15), 0)),""),इस सूत्र को एक रिक्त कक्ष में दर्ज करें, उदाहरण के लिए D2, फिर दबाएँ Ctrl + Shift + Enter कुंजियाँ एक साथ, स्क्रीनशॉट देखें:

दस्तावेज़ मानदंड 2 के आधार पर पाठ को संयोजित करें

टिप: उपरोक्त सूत्र में, A2: A15 वह सूची डेटा श्रेणी है जिससे आप अद्वितीय मान निकालना चाहते हैं, D1 कॉलम का पहला सेल है जिसे आप निकालने का परिणाम डालना चाहते हैं।

2. और फिर रिक्त स्थान प्रदर्शित होने तक सभी अद्वितीय मान निकालने के लिए भरण हैंडल को नीचे खींचें, स्क्रीनशॉट देखें:

दस्तावेज़ मानदंड 3 के आधार पर पाठ को संयोजित करें

3. इस चरण में, आपको एक बनाना चाहिए उपयोगकर्ता परिभाषित फ़ंक्शन विशिष्ट आईडी नंबरों के आधार पर नामों को संयोजित करने के लिए कृपया इसे दबाए रखें ALT + F11 कुंजियाँ, और यह खुल जाती है अनुप्रयोगों के लिए माइक्रोसॉफ्ट विज़ुअल बेसिक खिड़की.

4। क्लिक करें सम्मिलित करें > मॉड्यूल, और निम्नलिखित कोड को इसमें पेस्ट करें मॉड्यूल खिड़की।

वीबीए कोड: मानदंडों के आधार पर पाठ को संक्षिप्त करें

Function ConcatenateIf(CriteriaRange As Range, Condition As Variant, ConcatenateRange As Range, Optional Separator As String = ",") As Variant
'Updateby Extendoffice
Dim xResult As String
On Error Resume Next
If CriteriaRange.Count <> ConcatenateRange.Count Then
    ConcatenateIf = CVErr(xlErrRef)
    Exit Function
End If
For i = 1 To CriteriaRange.Count
    If CriteriaRange.Cells(i).Value = Condition Then
        xResult = xResult & Separator & ConcatenateRange.Cells(i).Value
    End If
Next i
If xResult <> "" Then
    xResult = VBA.Mid(xResult, VBA.Len(Separator) + 1)
End If
ConcatenateIf = xResult
Exit Function
End Function

5. फिर इस कोड को सहेजें और बंद करें, अपनी वर्कशीट पर वापस जाएं, और इस सूत्र को सेल E2 में दर्ज करें, =CONCATENATEIF($A$2:$A$15, D2, $B$2:$B$15, ",") , स्क्रीनशॉट देखें:

दस्तावेज़ मानदंड 4 के आधार पर पाठ को संयोजित करें

6. फिर भरण हैंडल को उन कक्षों तक नीचे खींचें जहां आप इस सूत्र को लागू करना चाहते हैं, और सभी संबंधित नामों को आईडी संख्याओं के आधार पर संयोजित कर दिया गया है, स्क्रीनशॉट देखें:

दस्तावेज़ मानदंड 5 के आधार पर पाठ को संयोजित करें

सुझाव:

1. उपरोक्त सूत्र में, A2: A15 वह मूल डेटा है जिसके आधार पर आप संयोजन करना चाहते हैं, D2 आपके द्वारा निकाला गया अद्वितीय मान है, और B2: B15 वह नाम कॉलम है जिसे आप एक साथ जोड़ना चाहते हैं।

2. जैसा कि आप देख सकते हैं, मैंने उन मानों को संयोजित किया है जो अल्पविराम द्वारा अलग किए गए हैं, आप अपनी आवश्यकता के अनुसार सूत्र के अल्पविराम "," को बदलकर किसी अन्य वर्ण का उपयोग कर सकते हैं।


यदि आपके पास एक्सेल के लिए कुटूल, के साथ अपने उन्नत संयोजन पंक्तियाँ उपयोगिता, आप मानदंड के आधार पर पाठ को जल्दी और आसानी से जोड़ सकते हैं।

एक्सेल के लिए कुटूल : 300 से अधिक उपयोगी एक्सेल ऐड-इन्स के साथ, 30 दिनों में बिना किसी सीमा के आज़माने के लिए निःशुल्क.

स्थापित करने के बाद एक्सेल के लिए कुटूल, निम्न चरणों का पालन करें:

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

2। क्लिक करें कुटूल > विलय और विभाजन > उन्नत संयोजन पंक्तियाँ, स्क्रीनशॉट देखें:

3. में कॉलम के आधार पर पंक्तियों को संयोजित करें संवाद बॉक्स में, आईडी कॉलम पर क्लिक करें और फिर क्लिक करें प्राथमिक कुंजी इस कॉलम को मुख्य कॉलम बनाने के लिए जिस पर आपका संयुक्त डेटा आधारित है, स्क्रीनशॉट देखें:

दस्तावेज़ मानदंड 7 के आधार पर पाठ को संयोजित करें

4। और फिर क्लिक करें नाम जिस कॉलम में आप मानों को संयोजित करना चाहते हैं, उस पर क्लिक करें मिलाना विकल्प, और संयुक्त डेटा के लिए एक विभाजक चुनें, स्क्रीनशॉट देखें:

दस्तावेज़ मानदंड 8 के आधार पर पाठ को संयोजित करें

5. ये सेटिंग्स ख़त्म करने के बाद क्लिक करें OK संवाद से बाहर निकलने के लिए, और कॉलम बी में डेटा को कुंजी कॉलम ए के आधार पर एक साथ जोड़ दिया गया है। स्क्रीनशॉट देखें:

दस्तावेज़ मानदंड 9 के आधार पर पाठ को संयोजित करें

इस सुविधा से निम्नलिखित समस्या का यथाशीघ्र समाधान हो जाएगा:

एक्सेल में एकाधिक पंक्तियों को एक में कैसे संयोजित करें और डुप्लिकेट को कैसे जोड़ें?

एक्सेल के लिए कुटूल अभी डाउनलोड करें और निःशुल्क परीक्षण करें!


एक्सेल के लिए कुटूल: 300 से अधिक उपयोगी एक्सेल ऐड-इन्स के साथ, 30 दिनों में बिना किसी सीमा के आज़माने के लिए निःशुल्क। अभी डाउनलोड करें और निःशुल्क परीक्षण करें!

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

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

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

Description


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

  • Word, Excel, PowerPoint में टैब्ड संपादन और रीडिंग सक्षम करें, प्रकाशक, एक्सेस, विसियो और प्रोजेक्ट।
  • नई विंडो के बजाय एक ही विंडो के नए टैब में एकाधिक दस्तावेज़ खोलें और बनाएं।
  • आपकी उत्पादकता 50% बढ़ जाती है, और आपके लिए हर दिन सैकड़ों माउस क्लिक कम हो जाते हैं!
Comments (38)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Great function! Is there a way to maintain the format in the cell it's concatenating data from? i.e. $45.07, $555.34, $0.00, $0.25, -$12.25 I've figured out how to stack them with wrap text and CHAR(10) in place of "," but having trouble keeping the format. I will be using this for a mail merge in Word.
This comment was minimized by the moderator on the site
Hello, Laurie,If you want to keep the cell formatting when concatenating the data, you can apply the Advanced Combine Rows feature of Kutools for Excel, in the dialog box, after finishing the settings, you just need to check Use formatted values option, and all the data formatting will be kept as you need.
You can download Kutools for Excel and free trial 30-day.
This comment was minimized by the moderator on the site
Is there any way to add "and" instead of "," before the last data? (For example: D2355, D2273, D2397, D2600 and D2386)
This comment was minimized by the moderator on the site
Hi, Hossain,May be there is not a direct method for solving your problem, you can add another formula to convert the last comma to the text "and".=SUBSTITUTE(E2,","," and ",LEN(E2)-LEN(SUBSTITUTE(E2,",","")))
Please try, thank you!
This comment was minimized by the moderator on the site
It worked like a charm sir. Thank you so much.
This comment was minimized by the moderator on the site
Great function, exactly what I needed! Works like a charm
This comment was minimized by the moderator on the site
Hi,

Very helpful VBA solution. Thank you kindly! My question is: Is there a way to change the code or function for multiple criteria? Although the code works for me, I need it to show values corresponding to a timestamp-interval (>= timestamp A, <= timestamp B)


Thank you in advance. :)
This comment was minimized by the moderator on the site
Is there a way to assign this to a button? On large data ranges it takes a while, so ideally I only want it to start the concatenate process once I've finished doing everything else in the sheet. I tried adding a trigger myself but it stopped working completely
This comment was minimized by the moderator on the site
BTW i used the VBA solution
This comment was minimized by the moderator on the site
Extremely helpfull! After editing it for my sheet i have #VALUE! for some of the unique values.
I did a countif to see if it could be that there are too many names to concatenate. The two unique values that have the #VALUE! error have 13635 and 19810 results. Is there a way to overcome this?
This comment was minimized by the moderator on the site
How can I ignore blank cells? mine currently displays this:

";;;;;;;;;"

I'd like for the 1st, 3rd and last 3 semi colons not to there/show. TIA
This comment was minimized by the moderator on the site
Hello, Chantelle
When concatenating the cell values ignoring the blank cells, please apply the below User Defined Function:

Function ConcatenateIf(CriteriaRange As Range, Condition As Variant, ConcatenateRange As Range, Optional Separator As String = ",") As Variant
Dim xResult As String
On Error Resume Next
If CriteriaRange.Count <> ConcatenateRange.Count Then
ConcatenateIf = CVErr(xlErrRef)
Exit Function
End If
For i = 1 To CriteriaRange.Count
If CriteriaRange.Cells(i).Value = Condition Then
If ConcatenateRange.Cells(i).Value <> "" Then
xResult = xResult & Separator & ConcatenateRange.Cells(i).Value
End If
End If
Next i
If xResult <> "" Then
xResult = VBA.Mid(xResult, VBA.Len(Separator) + 1)
End If
ConcatenateIf = xResult
Exit Function
End Function

Please try it, hope it can help you!
This comment was minimized by the moderator on the site
thank you very much! This was so simple and helped a lot!!
This comment was minimized by the moderator on the site
Is it possible to replace the comma splitter with a line break, i.e. char(10)? Many thanks.
This comment was minimized by the moderator on the site
Hello, David,

To combine the cells with line break, the following User Defined Function may help you.

Function ConcatenateIf_LineBreak(CriteriaRange As Range, Condition As Variant, ConcatenateRange As Range, Optional Separator As String = ",") As Variant
Dim xResult As String
On Error Resume Next
If CriteriaRange.Count <> ConcatenateRange.Count Then
ConcatenateIf = CVErr(xlErrRef)
Exit Function
End If
For I = 1 To CriteriaRange.Count
If CriteriaRange.Cells(I).Value = Condition Then
xResult = xResult & vbCrLf & ConcatenateRange.Cells(I).Value
End If
Next I
If xResult <> "" Then
xResult = VBA.Mid(xResult, VBA.Len(Separator) + 1)
End If
ConcatenateIf_LineBreak = xResult
Exit Function
End Function

After pasting this code, then apply this formula: =ConcatenateIf_LineBreak(A2:A13,F2,B2:B13,",").

After getting the results with this formula, you should click the Wrap Text to get the correct results you need.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations