Return the intersection value from a matrix in Excel

I would like a formula in Column  Risk Exposure (E4) to return the value from a matrix (RiskExposuretable) based on the intersection of the value in Column (Probability (C4)) and the value in Column (Impact (D4).
Test-Return-Intersection.xlsx
StevenPMoffatAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
The attached workbook contains a User Defined Formula called 'Intersection' in cell E4. Note that it's dependent on the sheet's structure. In other words if for example the location of the Risk Exposure Table changes then the UDF will need to be changed.
28689965.xlsm
0
StevenPMoffatAuthor Commented:
Can you make it reference the "RiskExposureTable" instead of being hard coded to reference to row 18 and column 4 in this line?
Intersection = Cells(I + 18, P + 4)
0
Wayne Taylor (webtubbs)Commented:
You can use this formula in cell E4...

    =INDEX(RiskExposureTable, MATCH(D4, Impact, 0)+1, MATCH(SUBSTITUTE(C4, "~", "~~"), Probability, 0)+2)

Wayne
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Martin LissOlder than dirtCommented:
Function Intersection(rngP As Range, rngI As Range) As String
Dim lngEntry As Long
Dim I As Integer
Dim P As Integer
Dim rngRET As Range

Set rngRET = Cells.Find(What:="Risk Exposure Table", After:=ActiveCell, LookIn:= _
        xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
        xlNext, MatchCase:=False, SearchFormat:=False)

For lngEntry = 1 To Range("Impact").Cells(1, 1).Row + Range("Impact").Rows.Count - 1
    If Range("Impact").Cells(lngEntry, 1) = rngI Then
        I = lngEntry
        Exit For
    End If
Next
For lngEntry = 1 To Range("Probability").Cells(1, 1).Row + Range("Probability").Columns.Count - 1
    If Range("Probability").Cells(1, lngEntry) = rngP Then
        P = lngEntry
        Exit For
    End If
Next

Intersection = Cells(I + rngRET.Row + 3, P + rngRET.Column + 1)
End Function

Open in new window

0
Martin LissOlder than dirtCommented:
BTW aren't at least your pink, 2 and 3, column values backward? In other words under 2, as the Impact increases, shouldn't it go from Manageable to Threatening and not the opposite as you have it?
0
StevenPMoffatAuthor Commented:
You are right, the risk values are backwards, that I leave that up to the author.
0
StevenPMoffatAuthor Commented:
Both options were acceptable and I thank you for the feedback.
0
Martin LissOlder than dirtCommented:
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Spreadsheets

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.