combining multiple formulas in one cell (not an if statement, does multiple formulas to create one answer)

dev 0 Reputation points
2025-12-05T20:39:00.2433333+00:00

currently to find an answer I have several formulas to find result I am looking to find.

My data is in cells A thru M with lookup tables on a separate tab

Column O thru R have formulas to find different parts of what will ultimately be the result I need.

Cell O is a vlookup formula =VLOOKUP(J3,ProviderFundsLookup,2), where the lookup table is on a different tab

Cell P grabs the first two digits of data in column E formula =LEFT(E3,2)

Cell Q adds data based on results in column O formula =IF(O3="7MF2", "0001", "01")

Cell R adds results of column O, P and Q and combines them =+O3&P3&Q3

Can I do all of this in one column instead of taking four columns to do it?User's image

Microsoft 365 and Office | Excel | Other | Windows
{count} votes

4 answers

Sort by: Most helpful
  1. Barry Schwarz 4,871 Reputation points
    2025-12-05T22:57:54.5866667+00:00

    You don't need to store the results of each formula. You can chain the formulas together directly.

    =VLOOKUP(J3,
    

    But debugging long formulas like this tends to be more difficult. You can use the LET function to keep track of the intermediate values and combine them at the end to form your final value.

    =LET(x,VLOOKUP(J3,ProviderFundsLookup,2),
         y,LEFT(E3,2),
         z,IF(O3="7MF2", "0001", "01"),
         x&y&z)
    
    

    Either approach eliminates the need for helper cells to hold temporary values.


  2. Kai-H 6,175 Reputation points Microsoft External Staff Moderator
    2025-12-07T07:04:54.57+00:00

    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. 

    0 comments No comments

  3. Kai-H 6,175 Reputation points Microsoft External Staff Moderator
    2025-12-08T14:25:05.3+00:00

    Hi dev

    It has been a while and I am writing to see how things are going with this issue.

    Have you had a chance to check the replies provided?

    Any update would be appreciated.


  4. dev 0 Reputation points
    2025-12-10T17:11:21.7233333+00:00

    THIS IS NOW RESOLVED USING BARRY'S ASSISTANCE. I ENDED UP WITH

    =LET(x,VLOOKUP(K5,ProviderFundsLookup,2),

     y,LEFT(E5,2),
    
     z,IF(x="7MF2", "0001", "01"),
    
     x&y&z)
    

    I understand it leaves room for errors depending the the tables being used but for now simple is easier of succession planning, as the person after me may know even less about these formulas and how they work. thanks everyone


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.