+ Reply to Thread
Results 1 to 5 of 5

Concatenate & Indirect

  1. #1
    Forum Contributor
    Join Date
    03-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2016 (among others!)
    Posts
    331

    Concatenate & Indirect

    I have a custom function called DC which requires a rate and year passed to it. So the text =DC("PAT",2017) entered into a cell gives the answer 100000.

    I now have to extend this so that in certain situations PAT will become SPAT - and the easiest way to do it is to set a flag in a cell to S and then concatenate it. So I've used the following formula:

    =+CONCATENATE("=dc(" & """" & J54 & "PAT" & """" & ",2017)")

    and in text terms that gives me exactly the same result as if I had typed in the line as in the first line of this post. The problem is that when I use =INDIRECT(cell containing formula above) it spits out a #REF! error. What have I missed here - the text I typed and the text that is concatenated looks exactly the same so why does it not resolve properly?

    TIA

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Concatenate & Indirect

    I don't think you have to invoke INDIRECT here. INDIRECT will take whatever is between the parenthesis and interpret it as a range.

    I think you simply need =DC(J54 & "PAT",2017).
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

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

    Re: Concatenate & Indirect

    I think it would be better to do it this way in the cell containing the original formula:

    =DC(IF(condition,"S","") & "PAT",2017)

    where you will have to specify what condition is.

    Hope this helps.

    Pete

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: Concatenate & Indirect

    is DC a user defined function ?

    whats in J54 ?

    you want to setup
    =DC("PAT",2017)
    as an indirect
    What part is in a CELL
    not sure what
    =+CONCATENATE("=dc(" & """" & J54 & "PAT" & """" & ",2017)")

    =DC(" whatever is in J54 plus PAT" ,2017)
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    Forum Contributor
    Join Date
    03-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2016 (among others!)
    Posts
    331

    Re: Concatenate & Indirect

    Thanks for the help there guys - dflak was the first I saw and it worked a charm. Now to tackle my next problem no doubt!

+ 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. Indirect concatenate
    By smitjeff in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-16-2009, 07:08 PM
  2. Indirect, Concatenate, & ?
    By Harlan Grove in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 09-06-2005, 06:05 AM
  3. Indirect, Concatenate, & ?
    By Harlan Grove in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 09-06-2005, 04:05 AM
  4. Indirect, Concatenate, & ?
    By JEFF in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  5. [SOLVED] Indirect, Concatenate, & ?
    By JEFF in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  6. [SOLVED] Indirect, Concatenate, & ?
    By JEFF in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  7. Indirect, Concatenate, & ?
    By JEFF in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  8. Indirect, Concatenate, & ?
    By JEFF in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-21-2005, 04:05 PM

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