Finding Data from Other Columns

jonwhite1234

New Member
Joined
Jan 5, 2019
Messages
2
Good morning gang. Hope you're all well. My question is around a worksheet I have like this:
DivisionBusiness UnitIDOwnerValue SteamTierStatus
ChampionshipDelivery 114John SmithStream 4Tier BGood
ChampionshipDelivery 114John SmithStream 2Tier AGood
PremierDelivery 315Fred BloggsStream 7Bad
PremierDelivery 315Craig SmithStream 8Tier CGood

<tbody>
</tbody>

There are around 45000 rows - it's a beast. Tier options are Tier A, Tier B, Tier C or blank. What I what to do is to search on each ID number and where there is a Tier rating work out how high it is and then duplicate that rating across all rows for that ID number. So in the example above the code or formula would put "Tier A" in the Tier column for all rows with ID 14 and "Tier C" for all rows with ID 15.

Many moons ago I think I used and Index and Match with an MIN IF Statement to do something similar but I can't for the life of me make it work. Do you know if this is easy to code in VBA or if there's a formula I can use on another column for example to work it out then overwrite?

Any help at all would be just great! :)
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Re: Finding Data from Other Columns help!

Hello,

This works for the data supplied. Have assumed columns N and O are avaailable

Code:
Sub TIER_2()
    Application.ScreenUpdating = False
    Columns("C:C").Copy Range("N1")
    Range("N1:N" & Range("N" & Rows.Count).End(xlUp).Row).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("O1" _
        ), Unique:=True
    For MY_ID_ROW = 2 To Range("O" & Rows.Count).End(xlUp).Row
        MY_ID = Range("O" & MY_ID_ROW).Value
        Range("A1:G" & Range("D" & Rows.Count).End(xlUp).Row).AutoFilter Field:=3, Criteria1:=MY_ID
            Range("F2:F" & Range("F" & Rows.Count).End(xlUp).Row).SpecialCells(xlCellTypeVisible).Select
            For Each CELL In Selection
                MY_TIER = CELL
                If MY_TIER = "Tier A" Then
                    MY_TIER_VALUE = "Tier A"
                    GoTo CHANGE_TIER
                End If
                If MY_TIER = "Tier B" Then
                    If MY_TIER_VALUE = "" Or MY_TIER_VALUE = "Tier C" Then
                        MY_TIER_VALUE = MY_TIER
                    End If
                End If
                If MY_TIER = "Tier C" Then
                    If MY_TIER_VALUE = "" Then
                        MY_TIER_VALUE = MY_TIER
                    End If
                End If
                
        Next CELL
CHANGE_TIER:
            Range("F2:F" & Range("F" & Rows.Count).End(xlUp).Row).SpecialCells(xlCellTypeVisible).Select
            For Each CELL In Selection
                CELL.Value = MY_TIER_VALUE
            Next CELL
            MY_TIER_VALUE = ""
        Selection.AutoFilter
    Next MY_ID_ROW
    Columns("N:O").ClearContents
    Application.ScreenUpdating = True
End Sub

it is a bit convoluted, but its been quite a long day.
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,716
Members
449,093
Latest member
Mnur

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