+ Reply to Thread
Results 1 to 5 of 5

Enter formula only if a cell does not contain specific text

  1. #1
    Forum Contributor
    Join Date
    07-03-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    139

    Enter formula only if a cell does not contain specific text

    In a nut shell what I am trying to do is this.

    If cell B5 contains the text On-Going then in cell E5 should contain "N\A" if anything else then cell E5 should contain the following formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    What I have tried to do so far has not worked, formula listed below.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This produces the standard...."The formula you typed contains an error" message in Excel

    I also tried this

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    which gives me the N\A but only gives the text of the formula, not the actual formula!! (no brainer there, but I had to try it )

    Any help would be appreciated.

    Thank You

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Enter formula only if a cell does not contain specific text

    Use

    =IF(B5="On-Going","N\A",IF(D5>=C5,IF(AND(C5>0,D5>0),NETWORKDAYS(C5,D5),""),""))

    without the extra '=' sign
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Contributor
    Join Date
    05-07-2013
    Location
    apple valley ca
    MS-Off Ver
    Excel 2007
    Posts
    110

    Re: Enter formula only if a cell does not contain specific text

    you can make you "and" statement look like this. if(AND(d5>=c5,c5>0,d5>0),networkdays..... this statement means that all of it must result in a true answer. but im not sure what is going on in the the ,NETWORKDAYS(C5,D5) what is the c5,d5?? are you adding..
    if you can upload a sample sheet

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

    Re: Enter formula only if a cell does not contain specific text

    Try it without the = in the middle, like this:

    =IF(B5="On-Going","N\A",IF(D5>=C5,IF(AND(C5>0,D5>0),NETWORKDAYS(C5,D5),""),""))

    Hope this helps.

    Pete

  5. #5
    Forum Contributor
    Join Date
    07-03-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Enter formula only if a cell does not contain specific text

    Pete and Ace_XL - Awesome, thank you so much, I knew I was missing something trivial here!! 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. Replies: 3
    Last Post: 09-20-2013, 04:24 PM
  2. [SOLVED] Need formula to enter specific text if a column contains other specific text
    By sugarmags74 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-05-2012, 12:09 AM
  3. When a date entered on a specific cell, automatically enter a text in other cell
    By mmccra2858 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-13-2012, 09:57 AM
  4. MACRO: enter value in cell if another cell contains specific text
    By linakapp in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2011, 12:28 PM
  5. Enter text into a specific cell using a userform
    By Cushionsupplier in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2010, 05:38 PM

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