+ Reply to Thread
Results 1 to 6 of 6

Baffled by countif #Value error

  1. #1
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Baffled by countif #Value error

    Hi everyone,

    I have the following formula:

    =CA2&COUNTIF($CA$2:CA2,CA2)

    CA2 has a value that's derived from a macro. for some reason I am constently getting #Value for this formula.

    Whenver i used the asme formula on target cells that have formulas themselves (like the cells in which the macros derive their values) the correct result is shown. The CA cell is a long text string, where as the cell this value is derived from is only a formula . Perhaps this is the issue?

    Any ideas what I'm doing wrong?

    Thanks!

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,071

    Re: Baffled by countif #Value error

    Can you post a sample file?
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Baffled by countif #Value error

    Hi Special-K

    I'm afraid I cannot. I'm quite certain its due to the length of the text string. Are you aware of anyway to apply countif in the manner I listed above on a long text string?

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Baffled by countif #Value error

    Yes, it's because of the length of the string (255 is the limit)

    If 254 characters is enough for 2 cells to be considered a match, try
    =COUNTIF($CA$2:CA2,LEFT(CA2,254)&"*")
    Last edited by Jonmo1; 02-23-2015 at 12:06 PM.

  5. #5
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Baffled by countif #Value error

    hi Jonmo1,

    thanks very much, your formula worked perfectly. Unfortunately I have to use that formula on about 15000 rows in my worksheet. Is there anyways I can apply the following two formulas to a macro which could be called when another VBA macro is run (which generates the data from which your formula works)?:

    =LEFT(CA2,15)
    =CB2&COUNTIF($CB$2:CB2,CB2)

    thanks!!

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Baffled by countif #Value error

    something like

    Please Login or Register  to view this content.

+ 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] Amortization in a fiscal year... baffled.
    By legendarywalton in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-05-2014, 12:37 PM
  2. COUNTIFS Problem has got me baffled...Please Help!
    By ogbugsy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-23-2013, 10:47 AM
  3. Baffled by SumIf issue.
    By MLocke in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-02-2013, 03:31 PM
  4. [SOLVED] Excel 2007 : Baffled by the (lack of) result of a countif
    By neil40 in forum Excel General
    Replies: 1
    Last Post: 04-01-2012, 06:43 AM
  5. Strange Vlookup result - baffled
    By andycaps in forum Excel General
    Replies: 9
    Last Post: 01-18-2012, 08:58 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