Mapping Formula

meppwc

Well-known Member
Joined
May 16, 2003
Messages
626
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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
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,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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