+ Reply to Thread
Results 1 to 7 of 7

Formula to skip empty cells, numbers and text (only dates)

  1. #1
    Registered User
    Join Date
    09-01-2019
    Location
    Peru
    MS-Off Ver
    2019
    Posts
    7

    Formula to skip empty cells, numbers and text (only dates)

    Hi all,

    I am currently trying to copy a table without including blank cells, numbers and texts just dates, for example:

    A column
    (blank)
    1
    a
    (blank)
    2
    (blank)
    01/02/2019
    01/03/2019
    a

    and the results should be:

    C column
    01/02/2019
    01/03/2019

    despites of having a solution for blank cells with this function in C1. =INDEX($A$1:$A$11,SMALL(IF(A$1:A$11<>"",ROW(A$1:A$11)),ROWS(C$1:C1)))), I couldn't do it with numbers and texts, I tried it with a vba "ISDATE" function applied as =IF(ISDATE(A1),ROW(A$1:A$11)) "ISDATE" just works in a cell but not in a range as a COUNTIFS(). Would anyone be able to make any suggestions as to how to solve this?.

    I am new to this forum, I have searched for a lot of information and this solution is close to my problem.

    Any help is greatly appreciated

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Formula to skip empty cells, numbers and text (only dates)

    Are you sure those are real dates and not text looking like dates? Do a quick test with =isnumber(cell-ref)...FALSE indicates text and we will need to convert them
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    09-01-2019
    Location
    Peru
    MS-Off Ver
    2019
    Posts
    7

    Re: Formula to skip empty cells, numbers and text (only dates)

    Yes Sir, this is a number (TRUE). You can see in my example.

    A COLUMN
    (blank)
    2002
    two
    4
    (blank)
    four
    (blank)
    (blank)
    (blank)
    2003-11-24
    seven

    E COLUMN WITH "ISNUMBER($A$1:$A$11)"
    FALSE
    TRUE
    FALSE
    TRUE
    FALSE
    FALSE
    FALSE
    FALSE
    FALSE
    TRUE
    FALSE

    G COLUMN (WITH INDEX($A$1:$A$11;SMALL(IF(ISNUMBER($A$1:$A$11);ROW(A$1:A$11));ROWS(G$1:G1)))
    2002
    4
    37949
    #NUM!
    #NUM!
    #NUM!
    #NUM!
    #NUM!
    #NUM!
    #NUM!
    #NUM!

    I found a vba method, instead of ISNUMBER->IS_DATE
    Please Login or Register  to view this content.
    However, x value if just for a Cell, ISNUMBER function is for a range. How Can I change IS_DATE(cell) into a range =IS_DATE(A1:A11)?
    Or is there another way to do that?
    Last edited by Ivancovish; 11-28-2019 at 02:49 PM.

  4. #4
    Registered User
    Join Date
    09-01-2019
    Location
    Peru
    MS-Off Ver
    2019
    Posts
    7

    Re: Formula to skip empty cells, numbers and text (only dates)

    double post, I am sorry. How can I delete this?
    Last edited by Ivancovish; 11-28-2019 at 06:03 PM.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Formula to skip empty cells, numbers and text (only dates)

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

  6. #6
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Formula to skip empty cells, numbers and text (only dates)

    It depends if you numbers will every be above the numeric values of your dates eg 1/1/2000 is 36526, if they don't so as an array (shift control enter) the below may work


    =IFERROR(INDEX($A$1:$A$11,SMALL(IF(ISNUMBER($A$1:$A$11)*($A$1:$A$11>36526),ROW(A$1:A$11)),ROWS(G$1:G1))),"")

    you may need to change , to ; depending on your regional settings

  7. #7
    Registered User
    Join Date
    09-01-2019
    Location
    Peru
    MS-Off Ver
    2019
    Posts
    7

    Re: Formula to skip empty cells, numbers and text (only dates)

    Hi davsth,

    It works perfectly for my purpose, Thank you!!!

+ 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] In a range of cells, sum the numbers in sequence and skip the text values
    By redJohn89 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-02-2019, 11:33 PM
  2. 2016 excel: Skip & ignore empty cells in formula
    By ZMAFC94 in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 07-18-2018, 11:04 AM
  3. [SOLVED] Help with formula to skip NA cells & account for gaps in dates
    By almat514 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 10-13-2017, 05:56 PM
  4. Formula to Capture Only Dates With Corresponding Numbers (no empty cells)
    By LEORITY in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 06-15-2017, 01:18 AM
  5. Forumulas & functions:Concatenate with wrap text and skip empty cells
    By Linja13 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 07-14-2014, 11:19 AM
  6. [SOLVED] TimeSheet Help: Skip empty cells in a formula that lists a date range
    By CpnVenice in forum Excel - New Users/Basics
    Replies: 14
    Last Post: 06-23-2012, 06:31 AM
  7. Formula/Macro for copying, skip empty cells
    By joscar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-16-2011, 06:04 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