Excel 2016 How to conditional concatenate

Jfawcett

New Member
Joined
Aug 26, 2020
Messages
4
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hello,

I'm working in Excel 2016, unfortunately this can't be updated due to work.

In column A I'm trying to get the cells to read off the question numbers of the first 6 incorrect questions and column B the corresponding MW clips that go with each of those first 6 incorrect questions.

Any help would be greatly appreciated.

Thanks,

Jack
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Picture of file attached
 

Attachments

  • Screenshot 2020-11-09 152727.png
    Screenshot 2020-11-09 152727.png
    34.3 KB · Views: 13
Upvote 0
Cross posted Excel 2016 Conditional Concatenate

While we do allow Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered elsewhere.
 
Upvote 0
Are you happy using a UDF rather than a function?
 
Upvote 0
Ok, how about
VBA Code:
Function Questions(Rng As Range) As String
   Dim Cl As Range
   Dim i As Long
   For Each Cl In Rng
      If Cl.Value < Cells(4, Cl.Column) Then
         Questions = Questions & ", " & Cells(1, Cl.Column)
         i = i + 1
         If i = 6 Then Exit For
      End If
   Next Cl
   Questions = Mid(Questions, 3)
End Function
Function MwClips(Rng As Range) As String
   Dim Cl As Range
   Dim i As Long
   For Each Cl In Rng
      If Cl.Value < Cells(4, Cl.Column) Then
         MwClips = MwClips & ", " & Cells(2, Cl.Column)
         i = i + 1
         If i = 6 Then Exit For
      End If
   Next Cl
   MwClips = Mid(MwClips, 3)
End Function
+Fluff v2.xlsm
ABCDEFGHIJKLMNOPQRSTUV
1Question numbers12345a5b678a8b8c9a9b10a10b11a11b11c1213
2MW Clips13135a68a7217/1866822a646464282822a22a1010108772
3First 6 Incorrect QuestionsSuggested MW ClipsTypes of anglesSolve simpleNegative numbersCalculation to find halfDecimals add and subtractdecimals multiplyCoordinatesMoney problemMode from vertical line chartProbability from a graphProbability from a graphFactorsLCMDivision problemMoney problemProperties of 2D shapesFinding a % without a calculatorFraction of amount
411112122112223311131
54, 8a, 8b, 8c, 10a, 11c72, 64, 64, 64, 22a, 1011102122000221311031
63, 6, 8a, 8b, 8c, 10b68a, 8, 64, 64, 64, 22a11012102000223111031
Sheet1 (2)
Cell Formulas
RangeFormula
A5:A6A5=questions(C5:AU5)
B5:B6B5=MwClips(C5:AU5)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,169
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top