Struggling with VLOOKUP OR IF statement

MikeJHHT

New Member
Joined
Jan 8, 2020
Messages
39
Office Version
  1. 365
Platform
  1. Windows
I apologize if this sounds confusing in advance,

Column K contains a concatenate for the warehouse software i use for entering sales orders based off the first truck number.
Column R adds additional sales orders with the same truck number so it wont repeat step 1 which is K.

When i copy the sales order information into excel, it will fill in column B and D.

For every same customer, the truck numbers will be the same (unfortunately my example shows D11 should be with truck # 755 but customer service entered the name differently...

Is it possible if there is only truck number 750, column U will show (k2), but if there are more 750's it will add each additional cell from R

for example U2, should be =K2&R2&R3&R4&R5&R6&R7&R8&R9 (which is the start of the concatenate(K2) followed by the additions in (R)

also, im entering the truck numbers manually based off the similar customer names, is there a statement that would automate this?

Ive been struggling to search using the right terminology to get exactly what im looking for.
Thankyou as always for your time.


1594136315657.png
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
It is hard to work with a picture. Could you use the XL2BB add-in (icon in the menu) to post a screenshot of your data which also includes the expected results in column U.
 
Upvote 0
mass.shiplist.project.xlsx
ABDHJKLMNOQRSTU
1TRUCK #SO'SCUSTOMERBEGINNING OF TRUCK SETUPADDITION TO SAME TRUCK #
2750J689441137 J & O DISTRIBUTINGSTART010;200708;750;01;Y;25;S;J68944;T1;16:30;ENDADDS;J53329;T1;16:30;END
3751J533291171 WOOD HEAT LLC010;200708;751;01;Y;25;S;J53329;T1;16:30;ENDS;J59359;T1;16:30;END
4751J593591171 WOOD HEAT LLC010;200708;751;01;Y;25;S;J59359;T1;16:30;ENDS;J60322;T1;16:30;END
5751J603221171 WOOD HEAT LLC010;200708;751;01;Y;25;S;J60322;T1;16:30;ENDS;J62989;T1;16:30;END
6751J629891171 WOOD HEAT LLC 010;200708;751;01;Y;25;S;J62989;T1;16:30;ENDS;J63874;T1;16:30;END
7751J638741171 WOOD HEAT LLC010;200708;751;01;Y;25;S;J63874;T1;16:30;ENDS;J65429;T1;16:30;END
8751J654291171 WOOD HEAT LLC010;200708;751;01;Y;25;S;J65429;T1;16:30;ENDS;J67573;T1;16:30;END
9751J675731171 WOOD HEAT LLC010;200708;751;01;Y;25;S;J67573;T1;16:30;ENDS;J69102;T1;16:30;END
10751J691021171 WOOD HEAT LLC010;200708;751;01;Y;25;S;J69102;T1;16:30;ENDS;J60850;T1;16:30;END
11752J608508010 AMBLER FIREPLACE AND PATIO010;200708;752;01;Y;25;S;J60850;T1;16:30;ENDS;J63490;T1;16:30;END
12753J634908506*1 ALBER'S FIREPLACE, INC010;200708;753;01;Y;25;S;J63490;T1;16:30;ENDS;J63551;T1;16:30;END
13753J635518506*1 ALBER'S FIREPLACE, INC010;200708;753;01;Y;25;S;J63551;T1;16:30;ENDS;J63861;T1;16:30;END
14753J638618506*1 ALBER'S FIREPLACE, INC010;200708;753;01;Y;25;S;J63861;T1;16:30;ENDS;J66136;T1;16:30;END
15753J661368506*1 ALBER'S FIREPLACE, INC010;200708;753;01;Y;25;S;J66136;T1;16:30;ENDS;J63307;T1;16:30;END
16754J63307A1347 KRINGS STOVES & FIREPLACES010;200708;754;01;Y;25;S;J63307;T1;16:30;ENDS;J57749;T1;16:30;END
17755J57749A8010 AMBLER FIREPLACE & PATIO010;200708;755;01;Y;25;S;J57749;T1;16:30;ENDS;J59601;T1;16:30;END
18755J59601A8010 AMBLER FIREPLACE & PATIO010;200708;755;01;Y;25;S;J59601;T1;16:30;ENDS;J60067;T1;16:30;END
19755J60067A8010 AMBLER FIREPLACE & PATIO010;200708;755;01;Y;25;S;J60067;T1;16:30;ENDS;J60347;T1;16:30;END
20755J60347A8010 AMBLER FIREPLACE & PATIO010;200708;755;01;Y;25;S;J60347;T1;16:30;ENDS;J60407;T1;16:30;END
21755J60407A8010 AMBLER FIREPLACE & PATIO010;200708;755;01;Y;25;S;J60407;T1;16:30;ENDS;;T1;16:30;END
22
23
WILL CALLS
Cell Formulas
RangeFormula
B2:B21,D2:D21B2=paste!A1
K2:K21K2="010;"&TEXT(TODAY()+1,"yymmdd")&";"&A2&";01;Y;25;S;"&B2&";T1;16:30;END"
R2:R21R2="S;"&B3&";T1;16:30;END"
 
Last edited:
Upvote 0
Your screenshot in Post #5 was fine. It would be helpful if you could post a revised screenshot with the expected results in column U.
 
Upvote 0
unfortunately im not sure what statement would be proper for U
but it should look like this for example U2, should be =K2&R2&R3&R4&R5&R6&R7&R8&R9

which the statement if possible would pull the topping truck number from K and the following same truck numbers from R
 
Upvote 0
is it possible if there is only truck number 750, column U will show (k2), but if there are more 750's it will add each additional cell from R
for example U2, should be =K2&R2&R3&R4&R5&R6&R7&R8&R9 (which is the start of the concatenate(K2) followed by the additions in (R)
I just wanted to see what the results would look like in column U when only one truck number was present in column A and when duplicate truck numbers are present in column A. Could you give me what the contents of U2 would look like for Truck #750 and what U3 would look like for Truck #751, etc.
 
Upvote 0
Try:
VBA Code:
Sub concat()
    Application.ScreenUpdating = False
    Dim LastRow As Long, truck As Range, arr As Variant, RngList As Object, Val As String, strVal As String, rng As Range
    LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    arr = Range("A2:A" & LastRow).Resize(, 18).Value
    Set RngList = CreateObject("Scripting.Dictionary")
    For i = 1 To UBound(arr, 1)
        Val = arr(i, 1)
        If WorksheetFunction.CountIf(Range("A:A"), Val) = 1 Then
            Range("U" & i + 1) = Val
            Range("V" & i + 1) = arr(i, 11)
        Else
            If Not RngList.Exists(Val) Then
                RngList.Add Val, Nothing
                Range("U" & i + 1) = Val
                With Cells(1, 1).CurrentRegion
                    .AutoFilter 1, Val
                    For Each rng In Range("R2:R" & LastRow).SpecialCells(xlCellTypeVisible)
                        If strVal = "" Then strVal = rng Else strVal = strVal & ";" & rng
                    Next rng
                    Range("V" & i + 1) = arr(i, 11) & ";" & strVal
                End With
            End If
        End If
        strVal = ""
    Next i
    Range("A1").AutoFilter
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,464
Messages
6,124,966
Members
449,200
Latest member
Jamil ahmed

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