+ Reply to Thread
Results 1 to 12 of 12

If cell equals then put X

  1. #1
    Registered User
    Join Date
    05-31-2013
    Location
    Somewhere
    MS-Off Ver
    Microsoft 365
    Posts
    80

    If cell equals then put X

    I know this is supposed to be simple... but for some reason I can't figure it out today.

    Column A contains dates (ex. Thursday, August 22, 2013).

    What I am looking to do is this:

    If A4 contains the word "Thursday", put an X in C4. If it contains any other day of the week, leave blank.

    What is the formula I am looking for?

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

    Re: If cell equals then put X

    If they are real dates, then they don't contain "words"..So you can't test for the text string "Thursday"

    Try the Weekday Function..

    =IF(WEEKDAY(A4)=5,"X","")

    Sunday=1
    Monday=2
    etc
    Thursday=5
    etc.
    Saturday=7

  3. #3
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: If cell equals then put X

    Try:

    =IF(LEFT(A4,8)="Thursday","X","")
    Gary's Student

  4. #4
    Registered User
    Join Date
    05-31-2013
    Location
    Somewhere
    MS-Off Ver
    Microsoft 365
    Posts
    80

    Re: If cell equals then put X

    Now what if I want more than one condition?? Like if its a Thursday enter X, but if its a Wednesday, enter Z for example.

    Thanks a bunch!

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

    Re: If cell equals then put X

    OK, can you describe what you Actually want, instead of simplified examples..

    Often, the solution to the simplified version is not easily translated to the real version.
    or even vice versa, you may be overthinking and the solution is even simpler than what we think based on your simplified example..

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: If cell equals then put X

    We haven't established if the cell contains a true Excel date or just a text string.

    If cell A4 contains the date then what result do you get with this test formula:

    =ISNUMBER(A4)

    If the cell contains a true Excel date then that formula should return TRUE.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Registered User
    Join Date
    05-31-2013
    Location
    Somewhere
    MS-Off Ver
    Microsoft 365
    Posts
    80

    Re: If cell equals then put X

    What I wrote is not a simplified way. What I am waiting is this:

    If cell A4 is a Thursday, put X, if it is a Wednesday, put Z.

    The original formula worked perfect, but then I realized I need to keep track of Wednesdays as well in the same box. I am not sure how to add that to the original formula.

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

    Re: If cell equals then put X

    ok..

    =IF(WEEKDAY(A4)=5,"X",IF(WEEKDAY(A4)=4,"Z",""))

  9. #9
    Registered User
    Join Date
    08-05-2013
    Location
    USA
    MS-Off Ver
    2010
    Posts
    76

    Re: If cell equals then put X

    =if(or(weekday(a1)=5,weekday(a1)=4),"x","")

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

    Re: If cell equals then put X

    =if(weekday(a4)=5,"x",if(weekday(a4)=4,"z",""))
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: If cell equals then put X

    Maybe this...

    =IF(WEEKDAY(A4)=4,"Z",IF(WEEKDAY(A4)=5,"X",""))

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

    Re: If cell equals then put X

    Or if your dates are really just Text Strings (which has still not yet been established)

    Then try
    =IF(LEFT(A4,3)="Thu","X",IF(LEFT(A4,3)="Wed","Z"))

+ 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] When one cell equals value of another cell, then third cell displays text of fourth cell?
    By spookymyo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-12-2021, 02:12 PM
  2. [SOLVED] How to create/run "cell A equals Cell B put Cell C info in Cell D
    By abmb161 in forum Excel General
    Replies: 7
    Last Post: 02-05-2014, 02:20 AM
  3. Replies: 2
    Last Post: 03-24-2013, 10:58 PM
  4. if a:a (range) equals january and c:c equals gas then add g:g ($)
    By BCOz in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-29-2005, 03:45 PM
  5. Replies: 1
    Last Post: 06-01-2005, 07: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