+ Reply to Thread
Results 1 to 15 of 15

How to merge a substitute and RIGHT formula together, referencing the same cell.

  1. #1
    Forum Contributor JulianS96's Avatar
    Join Date
    11-01-2019
    Location
    England
    MS-Off Ver
    365 (work-99%), 2016 (home-1%)
    Posts
    266

    How to merge a substitute and RIGHT formula together, referencing the same cell.

    Hi forum,

    I have been trying this for a while now but can't work out how to merge these two formulas together:
    TRIM(SUBSTITUTE(B2,E2,""))
    &
    IFERROR((TRIM(RIGHT(C2,LEN(C2)-FIND(":",C2)))),C2)

    So that it can all be contained in one formula, without the need of the helper column as I have already.

    Sheet included with explanation of what I want to achieve.
    Last edited by JulianS96; 07-16-2021 at 04:37 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: How to merge a substitute and RIGHT formula together, referencing the same cell.

    Not pretty, but does exactly what you've asked for:

    =IFERROR((TRIM(RIGHT(TRIM(SUBSTITUTE(B2,LEFT(B2,IF(ISNUMBER(FIND(":",B2)),FIND(":",B2)-1,FIND(" ",B2,1)-1)),"")),LEN(TRIM(SUBSTITUTE(B2,LEFT(B2,IF(ISNUMBER(FIND(":",B2)),FIND(":",B2)-1,FIND(" ",B2,1)-1)),"")))-FIND(":",TRIM(SUBSTITUTE(B2,LEFT(B2,IF(ISNUMBER(FIND(":",B2)),FIND(":",B2)-1,FIND(" ",B2,1)-1)),"")))))),TRIM(SUBSTITUTE(B2,LEFT(B2,IF(ISNUMBER(FIND(":",B2)),FIND(":",B2)-1,FIND(" ",B2,1)-1)),"")))

    I am sure, if you explain in words what the process is here, that there'll be a more compact alternative.

    Do you still not have MS365? If you did, then the LET function would come in really handy here.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor JulianS96's Avatar
    Join Date
    11-01-2019
    Location
    England
    MS-Off Ver
    365 (work-99%), 2016 (home-1%)
    Posts
    266

    Re: How to merge a substitute and RIGHT formula together, referencing the same cell.

    Wow that is some monster formula! I don't care, if it works it works!!!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: How to merge a substitute and RIGHT formula together, referencing the same cell.

    I would care! And I would care because it's making the same calculations several times over. As I said, there may well be a more refined and less consumptive alternative.

    Do you have MS365??

  5. #5
    Forum Contributor JulianS96's Avatar
    Join Date
    11-01-2019
    Location
    England
    MS-Off Ver
    365 (work-99%), 2016 (home-1%)
    Posts
    266

    Re: How to merge a substitute and RIGHT formula together, referencing the same cell.

    Quote Originally Posted by AliGW View Post
    Do you still not have MS365? If you did, then the LET function would come in really handy here.
    I might do actually. on a company laptop and there's an "Autosave" function at the top left, I think that's Office 365?
    Oh lol, yeah I do. just checked Account and it says "Office 365 Enterprise"

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: How to merge a substitute and RIGHT formula together, referencing the same cell.

    Right - in that case, give me a few minutes.

  7. #7
    Forum Contributor JulianS96's Avatar
    Join Date
    11-01-2019
    Location
    England
    MS-Off Ver
    365 (work-99%), 2016 (home-1%)
    Posts
    266

    Re: How to merge a substitute and RIGHT formula together, referencing the same cell.

    Quote Originally Posted by AliGW View Post
    I am sure, if you explain in words what the process is here, that there'll be a more compact alternative.
    Ok I'll try. From Cell B2, I want to take out the text that is in Cell E2 from B2 and then remove the ":" in front of the new result.
    The formulas i used may not have been the best to use, but it's what I found online.

  8. #8
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,910

    Re: How to merge a substitute and RIGHT formula together, referencing the same cell.

    Another way:

    =TRIM(REPLACE(B2,1,IFERROR(FIND(":",B2),FIND(" ",B2,1)),""))

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: How to merge a substitute and RIGHT formula together, referencing the same cell.

    Just as an academic exercise, here's how to use the LET function (MS365) to combine your three formulae:

    =LET(c,LET(b,B2,e,IFERROR(LEFT(B2,IF(ISNUMBER(FIND(":",B2)),FIND(":",B2)-1,FIND(" ",B2,1)-1)),""),TRIM(SUBSTITUTE(b,e,""))),IFERROR((TRIM(RIGHT(c,LEN(c)-FIND(":",c)))),c))

    However, as I suspected, there's a much simpler way, it seems - see post #8.

  10. #10
    Forum Contributor JulianS96's Avatar
    Join Date
    11-01-2019
    Location
    England
    MS-Off Ver
    365 (work-99%), 2016 (home-1%)
    Posts
    266

    Re: How to merge a substitute and RIGHT formula together, referencing the same cell.

    @Phuocam

    That's a nice solution Pheocam! Thanks!
    Looking forward to seeing Ali's solution with this "new" "LET" function as well!
    Last edited by AliGW; 07-16-2021 at 05:10 AM. Reason: PLEASE don't quote unnecessarily!

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: How to merge a substitute and RIGHT formula together, referencing the same cell.

    It's already there!

  12. #12
    Forum Contributor JulianS96's Avatar
    Join Date
    11-01-2019
    Location
    England
    MS-Off Ver
    365 (work-99%), 2016 (home-1%)
    Posts
    266

    Re: How to merge a substitute and RIGHT formula together, referencing the same cell.

    Wow thanks Ali, that's kinda what I was exactly asking for as well. A way to "hold" or "keep" the "new" result form the first formula and take it through to the end to remove the ":".
    Both formulas work perfect thanks, and Thanks Ali for enlightening me to the LET function! Reminds me of the good old GCSE/ A-Level Maths days!
    Last edited by AliGW; 07-16-2021 at 05:11 AM. Reason: PLEASE don't quote unnecessarily!

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: How to merge a substitute and RIGHT formula together, referencing the same cell.

    I've just started playing with it myself, so this was fun to do.

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: How to merge a substitute and RIGHT formula together, referencing the same cell.

    FWiW... one formula to do the lot.

    =TRANSPOSE(FILTERXML("<A><B>"&SUBSTITUTE(IF(ISNUMBER(SEARCH(":",B2)),B2,SUBSTITUTE(B2," ",":",1)),":","</B><B>",1)&"</B></A>","//B"))
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: How to merge a substitute and RIGHT formula together, referencing the same cell.

    FILTERXML is the other new function I want to explore in my retirement. Got a bit of catching up to do there.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] assistance to merge 2 formula trim, substitute, len as one formula
    By JEAN1972 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-06-2017, 05:37 AM
  2. Add text at the end of cell when using the SUBSTITUTE formula
    By tm-tom in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-13-2016, 08:51 AM
  3. Substitute Circular referencing with algebra equation
    By kurifodo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-06-2015, 05:19 PM
  4. merge cell referencing...
    By ky4068 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-27-2014, 05:53 AM
  5. [SOLVED] Substitute Formula for Cell ID in Range
    By jerry.fein in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-21-2013, 01:19 PM
  6. Excel 2003 - VBA to substitute value from cell in formula
    By Belgarath75 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-23-2013, 06:51 AM
  7. Formula to identify substitute items in a cell?
    By ravikumar00008 in forum Excel General
    Replies: 10
    Last Post: 05-31-2012, 10:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1