+ Reply to Thread
Results 1 to 12 of 12

Use text string as formula

  1. #1
    Forum Contributor
    Join Date
    04-11-2014
    Location
    Norway
    MS-Off Ver
    Office 365 version 2302
    Posts
    152

    Use text string as formula

    Hi,

    I have this formula in my worksheet: ='C:\Fordelingsark\[Fordelingsark 2014-15.xlsx]4.2.16'!$AC$90

    I want the date (marked in red) to be changed to todays date.

    In other words, the formula will change from day to day.

    The formula is in cell B3.
    The date is in cell B1.

    It will be something like this: ='C:\Fordelingsark\[Fordelingsark 2014-15.xlsx]&B1&'!$AC$90

    but it won't work.


    Any ideas?

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Use text string as formula

    [deleted] wrong idea

    try this:

    B3: =INDIRECT("'C:\Fordelingsark\[Fordelingsark 2014-15.xlsx]"&$B$1&"'!"&$B$2)
    where:
    B1: =TODAY() or better I think: =TEXT(TODAY(),"d.m.yy")
    B2: $AC$90 (as text)

    it works if C:\Fordelingsark\[Fordelingsark 2014-15.xlsx is open

    or without cell with date:

    B3: =INDIRECT("'C:\Fordelingsark\[Fordelingsark 2014-15.xlsx]"&TEXT(TODAY(),"d.m.yy")&"'!"&$B$2)
    B2: $AC$90 (as text)
    Last edited by sandy666; 02-04-2016 at 07:02 AM. Reason: first idea was wrong

  3. #3
    Forum Contributor
    Join Date
    04-11-2014
    Location
    Norway
    MS-Off Ver
    Office 365 version 2302
    Posts
    152

    Re: Use text string as formula

    Hi sandy666, thanks for quick reply.

    This seems to work if I enter the date as text: '4.2.16

    But when use =TODAY() and format cell as Date, it will show the correct date and format in B1, but I think the formula in B3 pull it out as a number (42404) and the result is #REF!

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Use text string as formula

    then use second version of formula
    tab name is a text not a date format

  5. #5
    Forum Contributor
    Join Date
    04-11-2014
    Location
    Norway
    MS-Off Ver
    Office 365 version 2302
    Posts
    152

    Re: Use text string as formula

    I tried =TEXT(TODAY(),"d.m.yy")
    but it returns "4.2.yy", not 4.2.16

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Use text string as formula

    use norway letter for year (english year = y, norway year = ? I don't know )

    probably år but I am not sure
    Last edited by sandy666; 02-04-2016 at 07:46 AM.

  7. #7
    Forum Contributor
    Join Date
    04-11-2014
    Location
    Norway
    MS-Off Ver
    Office 365 version 2302
    Posts
    152

    Re: Use text string as formula

    Aha that worked. However, I want it to work without C:\Fordelingsark\[Fordelingsark 2014-15.xlsx is open.

    If I use the original formula, the value in B3 will be updated when i update the links in the workbook, even when the workbookbook with the linked cell isn't open.

    Is that possible?

  8. #8
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Use text string as formula

    INDIRECT() function doesn't work with closed file.

  9. #9
    Forum Contributor
    Join Date
    04-11-2014
    Location
    Norway
    MS-Off Ver
    Office 365 version 2302
    Posts
    152

    Re: Use text string as formula

    Ok, thank you for your help!

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Use text string as formula

    You are welcome

    If problem from post #1 is resolved mark thread as solved. Thank you

  11. #11
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,813

    Re: Use text string as formula

    As Sandy has said, INDIRECT does not work with closed files. If it is important to you to not have the "sending" file open, then you might like to search for and download the free add-in morefunc, which has a new function INDIRECT.EXT, and this does work with closed files.

    Hope this helps.

    Pete

  12. #12
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Use text string as formula

    Pete,
    morefunc, INDIRECT.EXT() doesn't work with Ex2010 (32/64) or higher, probably and this function works only with single reference.
    that is what I know for now but not checked for more

    edit:
    morefunc is not supported for a long time already


    worth reading
    SQL against INDIRECT()
    http://www.bygsoftware.com/examples/...SqlRequest.zip
    http://www.bygsoftware.com/Excel/SQL/UsingSql.html
    Last edited by sandy666; 02-04-2016 at 09:54 AM.

+ 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. Replies: 2
    Last Post: 11-18-2014, 06:26 AM
  2. Formula to find and return text string within a cell full of text strings
    By LightingPop in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-03-2013, 11:45 PM
  3. [SOLVED] Extract text from a string of text (amend formula to include new criteria)
    By robertguy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-10-2013, 04:53 PM
  4. [SOLVED] Find partial text string within another text string return original text into cell.
    By mikey42979 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-17-2013, 02:58 PM
  5. Formula to Find a specific text within a text string
    By ewong in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-13-2012, 01:36 PM
  6. [SOLVED] Highlight a portion of string text (the string text is a value of a formula)
    By RaymondH in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-02-2012, 06:50 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