+ Reply to Thread
Results 1 to 5 of 5

String Matching Error

  1. #1
    Registered User
    Join Date
    10-09-2015
    Location
    Portland, OR
    MS-Off Ver
    2010
    Posts
    9

    String Matching Error

    Hey Gang,

    I am having a bit of a problem with a script.

    =IF(EXACT('Costing Worksheet'!L3, "Closed"), J3=0, ABS((TODAY())-B3))

    What I am trying to accomplish is for the script to look at a cell ('Costing Worksheet'!L3), and in this cell is a drop down list, and if the list choice reads "Closed" I want the value "0" to populate cell J3 (The cell where the script resides) and if not I want it populated with the result of the calculation Today() - B3. For some reason I am getting a Circular Reference error, although I don't know why because I am not trying to pull any info from the originating cell (J3) just trying to populate it if the drop down list has "Closed" chosen. Is there another way to make sure "0" is printed to the originating cell in this case?

    Thanks,
    Straywire

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: String Matching Error

    Hi, welcome to the forum

    You dont need EXACT for this...
    =if('Costing Worksheet'!L3="Closed",0,TODAY()-B3)

    What sheet is this going on?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    10-09-2015
    Location
    Portland, OR
    MS-Off Ver
    2010
    Posts
    9

    Re: String Matching Error

    Thanks @FDibbins, I had to modify the "0" to "J3 = 0", for some reason it was just returning the value "TRUE"

    I am a Project Manager and am creating a spreadsheet for Costing Analysis and this script will check the status of each line item and return a value for the dashboard that will allow me determine "days in the system" based on whether or not the line item is still open or has been closed. This value will then be used to create 2 separate charts, one for open costing items and one for closed items.

    I will no doubt be hanging out here more since my VBA is a little rough, I just started this position, and I will be creating a lot of spreadsheets.

    Thanks again!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: String Matching Error

    If you wrap a number in "" it becomes text, and Im not sure where "J3 = 0" comes in? Is this another condition that needs to be met?

    this was just a standard formula, not VBA

  5. #5
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: String Matching Error

    If you are insistent on VBA then here are a couple of examples depending on what you are trying to do.

    I will use Ford's formula as an example.
    If you simply want to return the value of the formula as if it was on the sheet but it's actually not, then use this code.
    Please Login or Register  to view this content.
    If you want to put the formula into a cell using code, I use cell A1 as an example, then use this code.
    Please Login or Register  to view this content.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

+ 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. Matching specific portion of a string and retrieving the whole string
    By mellowtang in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-27-2015, 07:06 AM
  2. Finding Matching Data in one Column/Adding corresponding matching string value.
    By swade730 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-02-2013, 07:23 PM
  3. Partail String Matching
    By JonathanAshford in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-07-2013, 11:42 PM
  4. [SOLVED] Return matching string in array if cell contains string contained in the array
    By AaronsZ in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-03-2013, 01:55 PM
  5. Replies: 2
    Last Post: 01-02-2013, 08:35 AM
  6. [SOLVED] Matching a small # string against a larger # string
    By Newbie1973 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 04-01-2012, 07:28 PM
  7. Searching a String for a Matching Word from another String
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-23-2005, 04:01 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