Apr 25 2020 08:00 PM
Apr 27 2020 07:42 PM
=IF(ISNUMBER(SEARCH(OR("Sharpertek","BVV","Across" C2)),"populated",Blank)
Apr 27 2020 07:43 PM
Apr 27 2020 07:44 PM
Apr 27 2020 10:46 PM
Just to clarify
You'd like to identify certain key words (products) from column C and then populate column D with the corresponding vendor? Is that right?
If so how many different Key words do you need to look for?
Thanks
Wyn
Apr 28 2020 04:30 AM
Apr 28 2020 07:27 AM
Does not work, I get an error. Can you add it to my file I attached and see if you get it?
Apr 28 2020 08:39 AM
Did not work, it returned the same value in colunm D.
Apr 28 2020 09:45 AM
Apr 28 2020 10:11 AM
I have office 365, in the attached you will see Sheet 5 with a key I want to use. in the keyword column, these are searched within all of column C, and if they match it returns a value in Column D corresponding to the values under the Vendor column.
Apr 28 2020 10:23 AM
Apr 28 2020 10:37 AM
We need to be a little more specific here. Are you wanting to replace the values in column D of your data sheet with this logic? Should an additional column be created instead of overwriting data? Should the search be case-sensitive? - NO Additional column, I want to override that data, does not need to be case sensitive. I want to Search Column C based on my table, and replace the values in Column D that correspond to my table given.
In terms of a solution, were you wanting a formula solution (e.g. add another column in which to return results) or a VBA solution? Which ever is easier, I am new to excel. Is this going to be done repetitively? I notice this is a CSV file and it looks like it's from a web query from shopify. Is the master data somewhere else? You have an export I just did from Shopify, once I do it once I will update manually, I am just trying to do a mass update right now. Do you query to return it? If so, what is the URL or data source you're using? There may be a solution with Power Query we could use also. No return, can not give an URL.
Apr 28 2020 10:55 AM
@Golfnhockey12 in that case I'd opt for a VBA solution. The below code will do what you want. Install it in the workbook you want it run in.
Sub ReplaceVendors()
Dim SourceSheet As Worksheet
Dim CriteriaSheet As Worksheet
Dim DataRange As Range
Dim RowIndex As Long
Dim CriteriaIndex As Long
Dim Criteria As Variant
Dim Source As Variant
Dim Values As Variant
Set SourceSheet = ThisWorkbook.Worksheets("shopexcel")
Set CriteriaSheet = ThisWorkbook.Worksheets("Criteria")
With SourceSheet
Set DataRange = .Range("A2", .Cells(.Cells(.Rows.Count, 1).End(xlUp).Row, .Cells(1, .Columns.Count).End(xlToLeft).Column))
Source = DataRange.Value
End With
With CriteriaSheet
Criteria = .Range("A2", .Cells(.Cells(.Rows.Count, 1).End(xlUp).Row, .Cells(1, .Columns.Count).End(xlToLeft).Column))
End With
ReDim Values(1 To UBound(Source, 1), 1 To 1)
For RowIndex = LBound(Source, 1) To UBound(Source, 1)
Values(RowIndex, 1) = Source(RowIndex, 4)
For CriteriaIndex = LBound(Criteria, 1) To UBound(Criteria, 1)
If InStr(1, LCase(Source(RowIndex, 3)), LCase(Criteria(CriteriaIndex, 1)), vbTextCompare) > 0 Then
Values(RowIndex, 1) = Criteria(CriteriaIndex, 2)
Exit For
End If
Next CriteriaIndex
Next RowIndex
SourceSheet.Range("D2:D" & DataRange.Rows.Count).Value = Values
End Sub
HTH
Apr 28 2020 02:15 PM
my friend i am sending you a solution in msg and then check and tell me must you got your solution or not @Golfnhockey12
Apr 28 2020 02:18 PM
we got a solution my friend, check it and tell me @Golfnhockey12
Apr 28 2020 02:21 PM
Apr 28 2020 06:07 PM
I see what it did, but look at line 977, it has Sharpertek in Column C, but on your search column is has the word included.
Apr 28 2020 11:46 PM
This video shows how to do this type of thing using Excel's Power Query
Apr 29 2020 09:45 AM
@Wyn Hopkins that's a very clever method!
Apr 29 2020 02:24 PM
@Golfnhockey12 sharpertek, Across and Bvv is your critertia that's why your criteria word will be find in column C show as included its your target.
but right now what is your criteria?
can you tell me clearly?
Apr 29 2020 02:48 PM
And what you did worked, but instead of saying included I wanted the name of the vendor.