+ Reply to Thread
Results 1 to 8 of 8

wildcards to work with numbers & date format

  1. #1
    Forum Contributor
    Join Date
    05-10-2019
    Location
    Penang, Malaysia
    MS-Off Ver
    2016
    Posts
    262

    wildcards to work with numbers & date format

    Hi All,

    I need wildcard to work with any numbers or date format. I am using this formula: =IF(COUNTIF(C1,"*?"),"OK", ""). But it only works with text if something is being entered to C1.
    How to make wildcards to work with numbers & date format too?

    Please find attachment.

    Thank-You very much
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: wildcards to work with numbers & date format

    Is mean C1 is not blank?
    =IF(C1<>"","OK","")
    =IF(LEN(C1)>0,"OK","")
    =IF(ISBLANK(C1),"OK","")

    With the last one catch the space " ", the others not.
    Quang PT

  3. #3
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: wildcards to work with numbers & date format

    Are you saying if anything is entered in C1 to display "OK"? If so, try this:
    =IF(C1="","", "OK")

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: wildcards to work with numbers & date format

    Your question seems to be about detecting a blank cell, rather than about how to use wildcards.

    If you are only using one cell in the formula, use

    =IF(C1="","","OK")

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: wildcards to work with numbers & date format

    I think we might need more examples of what you are trying to do.

    One thing I would note is that Excel does not count by format -- so dates and numbers are the same thing as far as Excel sees, so we might need to understand what, for your purposes, are the differences between "date" numbers and "number" numbers.

    The specific wildcard in your example looks like it would be easily replaced with the COUNTA() function. The COUNTA() function essentially counts any non-blank cell, so it counts cells with any kind of number or text.

    A few different examples of how you want to use wildcards with the different "data types" that you have in mind would help us help you.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Forum Contributor
    Join Date
    05-10-2019
    Location
    Penang, Malaysia
    MS-Off Ver
    2016
    Posts
    262

    Re: wildcards to work with numbers & date format

    Hi Grebb11, bebo021999...

    thanks for you help. Oh dear! how silly I was & so much focused on the wildcards. when simple IF solved.

    Grebb11 solutions solved.

    reputation added to you both & will closed this thread.

    Thank-You very much

  7. #7
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: wildcards to work with numbers & date format

    Thanks for the rep and glad we could help.

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: wildcards to work with numbers & date format

    Quote Originally Posted by MrShorty View Post
    The COUNTA() function essentially counts any non-blank cell, so it counts cells with any kind of number or text.
    COUNTA counts cells that are not empty, which is different than non-blank. If a cell has a formula, it is not empty. The formula

    =IF(TRUE,"","X")

    gives a blank result, but the cell is not empty. Therefore COUNTA will count the cell as non-empty.

    The wildcard shown in the OP will match cells with a non-null string, but it will not match cells with numbers.

    The formula I gave will match any cell that is either empty or has a formula with a null string result.

+ 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] simple macro to format numbers doesnt work
    By fruitloop44 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2018, 12:52 AM
  2. Cannot get wildcards to work
    By Steve2107 in forum Excel General
    Replies: 6
    Last Post: 03-19-2015, 11:52 PM
  3. convereting numbers to dollars, format doesn't work
    By don@cuffedandwanted in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-17-2013, 01:08 AM
  4. How can i make the wildcards work?
    By dan2010 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-22-2010, 08:20 AM
  5. Will Sumproduct work with wildcards?
    By jchambers00 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-07-2007, 03:28 PM
  6. wildcards do not seem to work
    By Norman K via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-22-2005, 10:05 AM
  7. [SOLVED] the date format is not working ,sort by date doesn't work.
    By Rosa Campos in forum Excel General
    Replies: 1
    Last Post: 09-12-2005, 06: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