+ Reply to Thread
Results 1 to 9 of 9

Plot first 4 digits if it is in given range

  1. #1
    Forum Contributor
    Join Date
    02-15-2016
    Location
    India
    MS-Off Ver
    2016
    Posts
    657

    Plot first 4 digits if it is in given range

    Hello Friends

    Please find the attached file (Plot first 4 digits if it is in given range 250516.xlsx).

    I need to plot the cells B3:B79 if the conditions met for the first four digits.

    Case 1 - If the first 4 digits are > 364 and < 628 plot in light green cells D9:D25
    Case 2 - If the first 4 digits are >/= 628 then plot in light yellow cells F9:F63

    thanks in advance
    Sekar

  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,946

    Re: Plot first 4 digits if it is in given range

    I did this using a helper column (for the blue, you should be able to replicate it for the yellow)...
    1st know that the contents of A are not values, they are text, and 1 text cannot be greater then another, so the helper converts the text to a number, then sets up a progressive count, which I use to pull in the data

    I used I, but you can use what you want...
    I2=IF(AND(--LEFT(A2,4)>364,--LEFT(A2,4)<628),I1+1,I1)
    copied down.

    Then to pull in the data...
    F9=IFERROR(INDEX(A:A,MATCH(ROWS($A$1:A1),$I:$I,0)),"")
    copied down
    C13 0364-7MS00A does not qualify because it is = 364, and you said >
    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
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Plot first 4 digits if it is in given range

    c9
    Please Login or Register  to view this content.
    E9
    Please Login or Register  to view this content.
    Try this and copy towards down
    Samba

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

  4. #4
    Forum Contributor
    Join Date
    02-15-2016
    Location
    India
    MS-Off Ver
    2016
    Posts
    657

    Re: Plot first 4 digits if it is in given range

    Hello Ford

    thanks for your formulas,

    is there any way to avoid helpers (May be by using this <=VALUE(LEFT(A2,4))>).

    thanks again

  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,946

    Re: Plot first 4 digits if it is in given range

    Siva, nicely done I thought about using that ARRAY, but thought that if the OP has a lot of data, that slow things down, so I didnt bother. Nice to see what it looks like

  6. #6
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,372

    Re: Plot first 4 digits if it is in given range

    wrong post

  7. #7
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Plot first 4 digits if it is in given range

    Here's an array in C9 and drag down

    remember CSE

    Please Login or Register  to view this content.
    You can follow the same logic for the other column
    Happy with my advice? Click on the * reputation button below

  8. #8
    Forum Contributor
    Join Date
    02-15-2016
    Location
    India
    MS-Off Ver
    2016
    Posts
    657

    Re: Plot first 4 digits if it is in given range

    Hello Ford, Siva and Crooza

    Thanks for your formulas.

    Thanks again

  9. #9
    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,946

    Re: Plot first 4 digits if it is in given range

    Happy to help and thanks for the feedback

+ 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. Is it possible to find the min of the last few digits of a range.
    By Odlanier in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-09-2014, 10:38 AM
  2. Help with searching for a few digits in a range
    By Tkurtz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2013, 06:15 PM
  3. [SOLVED] Sum up the digits within a range of cells
    By freemaniam in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-14-2013, 07:03 AM
  4. Changing digits after decimal to specific digits based on a criteria
    By mpatel000 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-28-2012, 02:41 AM
  5. [SOLVED] Copy certain values (9 digits, numbers only) from range
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-11-2012, 12:24 PM
  6. range:Lookup the 1st 5 digits
    By David Hepner in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 05:05 AM
  7. Capture te first n digits of a range
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2005, 02: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