+ Reply to Thread
Results 1 to 26 of 26

Convert a formula text to a working formula without vba

  1. #1
    Registered User
    Join Date
    08-11-2023
    Location
    Tbilisi
    MS-Off Ver
    MS 365
    Posts
    16

    Convert a formula text to a working formula without vba

    Hello,

    B1=aaa; C1=bbb; D1=B1&C1; I need A1 to take formula text from D1 that is B1&C1 and return value aaabbb. I tried indirect("="&D1) but it returns REF error. Please help
    Attached Files Attached Files

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

    Re: Convert a formula text to a working formula without vba

    Try:

    =INDIRECT("D1")
    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

  3. #3
    Registered User
    Join Date
    08-11-2023
    Location
    Tbilisi
    MS-Off Ver
    MS 365
    Posts
    16

    Re: Convert a formula text to a working formula without vba

    also does not work, REF error

  4. #4
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,939

    Re: Convert a formula text to a working formula without vba

    Perhaps,

    =INDIRECT(LEFT(D1,FIND("&",D1)-1))&INDIRECT(RIGHT(D1,LEN(D1)-FIND("&",D1)))

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,301

    Re: Convert a formula text to a working formula without vba

    Quote Originally Posted by ngorg View Post
    also does not work, REF error
    It should return "B1&C1" (without the quote marks).
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    08-11-2023
    Location
    Tbilisi
    MS-Off Ver
    MS 365
    Posts
    16

    Re: Convert a formula text to a working formula without vba

    this works in this specific example, but instead of B1&C1 I have a large complex formula, I need more general formula to convert the text of a formula into the real formula

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,301

    Re: Convert a formula text to a working formula without vba

    You can't use INDIRECT that way. Each part of the formula would need to be a parameter. Have you thought of using a LET formula?

    =LET(a,"aaa",b,"bbb",c,a&b,c)

  8. #8
    Registered User
    Join Date
    08-11-2023
    Location
    Tbilisi
    MS-Off Ver
    MS 365
    Posts
    16

    Re: Convert a formula text to a working formula without vba

    It does not return a result, just REF error. I attached the file again with indirect (D1) resulting REF error

  9. #9
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Convert a formula text to a working formula without vba

    The function INDIRECT can only return a cell (or range) reference, not a formula.
    So its not possible to return the operand & by an INDIRECT-function.
    Last edited by HansDouwe; 09-01-2023 at 07:42 AM.

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

    Re: Convert a formula text to a working formula without vba

    Quote Originally Posted by ngorg View Post
    It does not return a result, just REF error. I attached the file again with indirect (D1) resulting REF error
    Glenn said this:

    =INDIRECT("D1")

    NOT this:

    =INDIRECT(D1)

    How about this?

    =LET(a,B1,b,C1,a&b)

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

    Re: Convert a formula text to a working formula without vba

    I was wrong... plain and simple!!

  12. #12
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,021

    Re: Convert a formula text to a working formula without vba

    Quote Originally Posted by ngorg View Post
    this works in this specific example, but instead of B1&C1 I have a large complex formula, I need more general formula to convert the text of a formula into the real formula
    You can't do that without some sort of macro, whether VBA or XLM.
    Last edited by romperstomper; 09-01-2023 at 07:55 AM.
    Everyone who confuses correlation and causation ends up dead.

  13. #13
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,939

    Re: Convert a formula text to a working formula without vba

    Perhaps, you can input in D1 =B1&C1 direct to get answer.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    08-11-2023
    Location
    Tbilisi
    MS-Off Ver
    MS 365
    Posts
    16

    Re: Convert a formula text to a working formula without vba

    Is there any way I can convert formula text in a cell to real formula? I have different kinds of formulas for different versions of cells. For example on the first sheet in A:A column is Version column, where A1=3, A2=2, A3=6... etc. On another sheet I have A:A column with version numbers and B:B column with formula type to use. I need on the first sheet B:B to index the formula text from second sheet (B:B), that matches the version type (A From sheet 1 and A:A from sheet2), and return the formula text on the first sheet B:B and convert it to real formula so it calculates the results on that sheet. So I need some way to convert formula text to real formula. I home I explained clearly. Thank you.

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

    Re: Convert a formula text to a working formula without vba

    Provide a more deatiled sample workbook with some examples of what you mean.

  16. #16
    Registered User
    Join Date
    08-11-2023
    Location
    Tbilisi
    MS-Off Ver
    MS 365
    Posts
    16

    Re: Convert a formula text to a working formula without vba

    Sorry, Indirect("D1") gives the result "B1&C1", I need it to calculate "B1&C1" and give the result "aaabbb".
    Let formula as I understand makes me use only one formula (a&b), I need the conversion to use different formulas according to different versions of a previous cell. (I have explained above)

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,301

    Re: Convert a formula text to a working formula without vba

    See post #15 - I'm waiting for a better sample workbook.

  18. #18
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Convert a formula text to a working formula without vba

    Is there any way I can convert formula text in a cell to real formula?
    I understand what you mean, but that is not possible in Excel.
    The function FORMULATEXT converts a real formula to text, but there is no inverse of the function FORMULATEXT that converts a text to a formula.

    You need to code all possible formula's and select the result of the formula you want.
    Sometimes you can combine different formulas in one formula.
    Last edited by HansDouwe; 09-01-2023 at 08:08 AM.

  19. #19
    Registered User
    Join Date
    08-11-2023
    Location
    Tbilisi
    MS-Off Ver
    MS 365
    Posts
    16

    Re: Convert a formula text to a working formula without vba

    This is the sample, thank you

  20. #20
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,301

    Re: Convert a formula text to a working formula without vba

    Try in H12 copied down:

    Please Login or Register  to view this content.
    Last edited by AliGW; 09-01-2023 at 08:40 AM.

  21. #21
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Convert a formula text to a working formula without vba

    Another way:

    Please activate all the formulas in columns K, L & M and try in G2 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by HansDouwe; 09-01-2023 at 08:51 AM.

  22. #22
    Registered User
    Join Date
    08-11-2023
    Location
    Tbilisi
    MS-Off Ver
    MS 365
    Posts
    16

    Re: Convert a formula text to a working formula without vba

    OMG this worked! Thank you!!!

  23. #23
    Registered User
    Join Date
    08-11-2023
    Location
    Tbilisi
    MS-Off Ver
    MS 365
    Posts
    16

    Re: Convert a formula text to a working formula without vba

    This also works !!!

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

    Re: Convert a formula text to a working formula without vba

    What worked? My solution or Hans'?

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  25. #25
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Convert a formula text to a working formula without vba

    Thanks for the feedback and rep. . Glad to have helped.

  26. #26
    Registered User
    Join Date
    08-11-2023
    Location
    Tbilisi
    MS-Off Ver
    MS 365
    Posts
    16

    Re: Convert a formula text to a working formula without vba

    both worked

+ 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. convert formula result to searchable text with a formula
    By BassemCh in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-17-2021, 04:01 PM
  2. [SOLVED] Convert text to columns using a formula Formula
    By nupema in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-08-2021, 02:07 PM
  3. Formula to convert text to date not working properly
    By dobracik in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-11-2020, 12:02 PM
  4. [SOLVED] Conditional Convert Formula not working
    By Bobby82 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-06-2014, 03:16 AM
  5. Convert Cell Formula to Convert Text to VBA Code
    By PY_ in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-08-2014, 05:51 PM
  6. Formula as text in cell -> convert to formula result
    By AHFoddeR in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-12-2013, 02:00 AM
  7. how to convert a formula into text in order to display the formula
    By Claudio Hartzstein in forum Excel General
    Replies: 2
    Last Post: 07-13-2006, 05:05 AM

Tags for this Thread

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