Mapping Formula

meppwc

Well-known Member
Joined
May 16, 2003
Messages
604
Office Version
  1. 365
Platform
  1. Windows
I am stuck with figuring out the correct formula for this situation. Your assistance is greatly appreciated.

Formula involves two worksheets named “MAIN” and “ORACLE”
Formula needed for cell W8327 of MAIN

Lookup value in S8327 of MAIN worksheet in column B of ORACLE worksheet
If found AND column BN of ORACLE equals “INV-MS SERVICE”, then map BH of MAIN to W8327 of MAIN.

If value not found in column B of ORACLE worksheet, then W8327 equals “MSN NOT FOUND”
If value is found in column B of ORACLE and value in BN does not equal “INV-MS SERVICE”, then W8327 equals “NOT ON SERVICE CONTRACT”
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Lookup value in S8327 of MAIN worksheet in column B of ORACLE worksheet
If found AND column BN of ORACLE equals “INV-MS SERVICE”,
When searching column B of ORACLE, what is the largest number of matches that could be found? Could the S8327 value appear at most one time, or multiple times?
And if the S8327 value is found in column B of ORACLE, does your "if found AND..." statement mean to look at column BN of ORACLE on that same matching/corresponding row?
 
Upvote 0
A small mock-up assuming the answers to my questions above are that only one match, at most, may occur in column B of ORACLE and if a match is found, you want the corresponding value from column BN on that same row in ORACLE.
Using this for ORACLE (I've inserted a leading "z" to make matches and non-matches for testing):
MrExcel_20240305.xlsx
BBLBMBN
1Col B HeadingCol BN Heading
2
3zluv123zINV-MS SERVICE
4
ORACLE

The MAIN sheet with some intermediate columns hidden:
MrExcel_20240305.xlsx
STWBEBH
8327luv123MSN NOT FOUNDcolBHval
MAIN
Cell Formulas
RangeFormula
W8327W8327=LET(r,MATCH($S8327,ORACLE!$B:$B,0), IF(ISERROR(r),"MSN NOT FOUND",IF(INDEX(ORACLE!$BN:$BN,r)="INV-MS SERVICE",$BH8327,"NOT ON SERVICE CONTRACT")))
 
Upvote 0
The formula returned "MSN NOT FOUND", even though the value in main, "3100R300888", also appears on Oracle in cell B5, "3100R300888"
 
Upvote 0
It works fine for me...at least based on the assumptions I mentioned. You'll need to post the formula you're using and answer the two questions I asked.
 
Upvote 0
The answer to both of your questions is yes. The value can only be found once. If found for example in cell B5, then over in BN5, I find the value of "INV-MS Service"
 
Upvote 0
Okay, so the assumptions made by the formula are met. Could you do a direct copy and paste of the formula into another post?
 
Upvote 0
Not sure I follow.........you want me to start a brand new post of what I am needing?
 
Upvote 0
No, just respond back with your formula, please.
 
Upvote 0
=LET(r,MATCH($S8327,ORACLE!$B:$B,0), IF(ISERROR(r),"MSN NOT FOUND",IF(INDEX(ORACLE!$BN:$BN,r)="INV-MS SERVICE",$BH8327,"NOT ON SERVICE CONTRACT")))
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,685
Members
449,117
Latest member
Aaagu

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