Hi, dev
Welcome to Microsoft Q&A forum.
Thanks for your question. You can collapse all four helper columns (O>P>Q>R) into one single formula in the destination column. Here are some ways you can execute it:
One-cell solution (simple, direct)
=VLOOKUP(J3,ProviderFundsLookup,2,FALSE) & LEFT(E3,2) &=
What it does:
- Looks up the funded program from J3 in ProviderFundsLookup > takes column 2
- Takes the first two characters of E3
- Appends "0001" when the lookup result is "7MF2", otherwise "01"
- Concatenates them into the final code
Tip: Use FALSE in VLOOKUP for exact match. Omit it only if your table is sorted ascending and you truly want approximate matches.
Faster and cleaner version with LET (no repeated lookup)
If your Excel supports LET, this avoids repeating the lookup and is easier to maintain:
=LET(
pf pf, VLOOKUP(J3,ProviderFundsLookup,2,FALSE),
rec, LEFT(E3,2),
suf, IF(pf="7MF2","0001","01"),
pf & rec & suf
More robust version with IFERROR
Prevents #N/A errors when the lookup fails and returns an empty string instead. Adjust the fallback as you need.
=LET(
pf, IFERROR(VLOOKUP(J3,ProviderFundsLookup,2,FALSE), ""),
rec, LEFT(E3,2),
suf, IF(pf="7MF2","0001","01"),
pf & rec & suf
)
Optional: Use XLOOKUP instead of VLOOKUP (recommended)
If you have modern Excel, XLOOKUP is safer and more flexible.
=LET(
pf, XLOOKUP(J3, INDEX(ProviderFundsLookup,,1), INDEX(ProviderFundsLookup,,2), ""),
rec, LEFT(E3,2),
suf, IF(pf="7MF2","0001","01"),
pf & rec & suf
)
- INDEX(ProviderFundsLookup,,1) > first column as the key
- INDEX(ProviderFundsLookup,,2) > return the second column
- "" > return blank if not found
Notes
- Concatenation in Excel uses &, not +. Your final column R already uses &, which is correct.
- If E3 can be blank or shorter than 2 characters, wrap LEFT(E3,2) in IFERROR(LEFT(E3,2),"").
- If ProviderFundsLookup is a structured Table (e.g., Table1), you can reference columns explicitly, which is often clearer:
=LET(
pf, XLOOKUP(J3, Table1[Key], Table1[FundedProgram], ""),
rec, LEFT(E3,2),
suf, IF(pf="7MF2","0001","01"),
pf & rec & suf
)
Hope this helps. Feel free to get back if you need further assistance.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment."
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.