+ Reply to Thread
Results 1 to 8 of 8

Extract number with criteria

  1. #1
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Extract number with criteria

    hi all....

    i want to extract the number became year:

    1995-7-xxxxxx ======= 1995
    2015-12-xxx========= 2015
    2010-07-xxxx======== 2011
    2010-06-xxxx======== 2010

    criteria:
    - if data ">=July 2010" ----show 2011
    - if data between 2010-01-xxx to 2010-06-xxxxx -----show 2010
    any assistance, much appreciated..

    john m

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Extract number with criteria

    Hi,

    If your data starts in A1 then put this formula in another cell and drag down:

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


    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: Extract number with criteria

    hi abousetta, not fully working
    e.g

    2010-06-2154 ---2010 (your formula correct)
    2010-07-2154--2011 (your formula correct)
    2011-06-2154 --2011 (your formula correct)
    2011-07-2154 --2012 (your formula false), should be keep 2011 not 2012

    note : only in 2010 have criteria like in post #1

  4. #4
    Registered User
    Join Date
    08-22-2015
    Location
    Dhaka
    MS-Off Ver
    office 8
    Posts
    33

    Re: Extract number with criteria

    =IF(VALUE(SUBSTITUTE(RIGHT(LEFT(A1,FIND("-",A1)+2),2),"-",""))>6,VALUE(LEFT(A1,4))+1,VALUE(LEFT(A1,4)))

    this one will do your job.

  5. #5
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: Extract number with criteria

    Quote Originally Posted by nahidking View Post
    =IF(VALUE(SUBSTITUTE(RIGHT(LEFT(A1,FIND("-",A1)+2),2),"-",""))>6,VALUE(LEFT(A1,4))+1,VALUE(LEFT(A1,4)))

    this one will do your job.
    thanks but not fully working
    only in year 2010 have criteria

    2011-05-2154 ---2011 (correct)
    2011-07-2154 ---2012 (incorrect) ---2011 (should be)

  6. #6
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Extract number with criteria

    =left(a1,4)+(--left(a1,4)=2010)*(--substitute(mid(a1,5,3),"-","")>6)
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  7. #7
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: Extract number with criteria

    hi Siva, 100% working!!!!

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Extract number with criteria

    Data Range
    A
    B
    1
    2010-06-2154
    2010
    2
    2010-07-2154
    2011
    3
    2011-06-2154
    2011
    4
    2011-07-2154
    2012

    Data Range
    B
    1
    =IFERROR(LEFT(A1,4)+MOD(MID(A1,6,2),6),"")


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

+ 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: 12-18-2014, 10:27 AM
  2. extract number from text and number cell
    By south in forum Excel General
    Replies: 15
    Last Post: 08-23-2014, 03:28 AM
  3. [SOLVED] extract number from filename with criteria
    By pankaj8219 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-06-2013, 05:28 PM
  4. Extract data with 2 criteria
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2012, 06:48 PM
  5. Extract Data_Under certain Criteria
    By manuel1991 in forum Excel General
    Replies: 2
    Last Post: 10-25-2012, 03:19 PM
  6. [SOLVED] Extract data[number] from a set of [words,number and symbol] and place into column
    By dragon_m0nsta in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-12-2012, 08:31 PM
  7. [SOLVED] How to extract Fist number, Last number from string and SUM
    By Xiaojiang in forum Excel General
    Replies: 5
    Last Post: 05-07-2012, 01:39 AM
  8. [SOLVED] Extract number from text/number string..
    By nastech in forum Excel General
    Replies: 5
    Last Post: 07-05-2006, 06:25 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