+ Reply to Thread
Results 1 to 5 of 5

If a cell contains a value WITHOUT picking up text in the formula used to get that value

  1. #1
    Registered User
    Join Date
    07-23-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    3

    If a cell contains a value WITHOUT picking up text in the formula used to get that value

    Hi, I have been trying to find a way around this for days and can't find a clean simple way of doing this although I'm sure there must be an easy way I have missed.

    Essentially, is there a way for a formula to look up a 'value' e.g. "X", in a cell without picking up the content of the formula which may also contain "X"...?

    Example
    In row A10 I want to flag if a range of cells above it (A1:A9) contain "X" or if they are all blank, i.e. "".

    However, because the cells A1:A9 have formulae that determines whether they are X or blank, e.g.=IF(AND(CB$7>=$BL12,CB$7<=$BM12),"X",""),
    each time I try a formula such as IFBLANK, or (IF(ISERROR(MATCH("X",A1:A9,1)),"no","yes") these seem to pick up the X in the formulae itself.

    Ideally, a IFBLANK formula would be good, but since the cells have formula in them they all show as non-blank, even though the value of the cell may be " ". Or is there a way around this.

    Any help with this would be massively appreciated.

    Thanks.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: If a cell contains a value WITHOUT picking up text in the formula used to get that val

    Formulas can't access the formula constructs in a cell. They only see the results.
    Would something like this help?:
    =IF(COUNTIF(A1:A9,"*x*"),"Yes","No")

    That formula returns "Yes" if any of the referenced cell values contain "x".
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

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

    Re: If a cell contains a value WITHOUT picking up text in the formula used to get that val

    You might be able to use CELL("type",...)
    a return of "b" (presumably "b" for "blank"?) indicates the cell contains neither a formula nor a value
    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.

  4. #4
    Registered User
    Join Date
    07-23-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    3

    Thumbs up Re: If a cell contains a value WITHOUT picking up text in the formula used to get that val

    Quote Originally Posted by Ron Coderre View Post
    Formulas can't access the formula constructs in a cell. They only see the results.
    Would something like this help?:
    =IF(COUNTIF(A1:A9,"*x*"),"Yes","No")

    That formula returns "Yes" if any of the referenced cell values contain "x".

    Many thanks Ron, that is working perfectly. I tried something similar but couldn't make it work, but your formula seems to be working fine.

    Thanks.

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: If a cell contains a value WITHOUT picking up text in the formula used to get that val

    Hello AdamC1, and welcome to the forum.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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