+ Reply to Thread
Results 1 to 6 of 6

Trying to write a formula to highlight calls containing a value greater than 50

  1. #1
    Registered User
    Join Date
    12-29-2018
    Location
    NJ
    MS-Off Ver
    OFFICE PRO PLUS 2013
    Posts
    7

    Trying to write a formula to highlight calls containing a value greater than 50

    I'm trying to write a visual basic command to find all 3 digit numbers that have a value right of the hyphen greater than 50 and if so fill the cell blue. I have very little knowledge and need some help. Thanks in advance.

  2. #2
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    419

    Re: Trying to write a formula to highlight calls containing a value greater than 50

    If you only want three digit numbers, then aren't you interested in numbers > 100? What you are asking is quite easy, but it's difficult to answer without seeing your workbook - can you upload it?

  3. #3
    Registered User
    Join Date
    12-29-2018
    Location
    NJ
    MS-Off Ver
    OFFICE PRO PLUS 2013
    Posts
    7

    Re: Trying to write a formula to highlight calls containing a value greater than 50

    Thank you for the reply.
    Example:
    123-55
    456-25
    445566-22
    4545-8
    788-15
    54454-10
    I'm trying to have it identify only 3 digit numbers left of the hyphen that have a value greater than 50 right of the hyphen, if so fill color blue.

  4. #4
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    419

    Re: Trying to write a formula to highlight calls containing a value greater than 50

    Ok, this should get you started:
    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Trying to write a formula to highlight calls containing a value greater than 50

    Hello.

    In what follows, I'll assume your data is from cell A1 down.

    Instead of filling your active sheet with ugly colors, the attached VBA code gives you beautiful and funky symbols:

    PHP Code: 
    Sub Macro8()
    Dim aQ&, i&, b
    With ActiveSheet
    .[a1].CurrentRegion
      a 
    = .ValueUBound(a): ReDim Preserve a(1 To Q1 To 2)
      For 
    1 To Q
        b 
    Split(a(i1), "-")
        If 
    Len(b(0)) = And b(1) > 50 Then a(i2) = ChrW(9194)
      
    Next
      
    .Resize(, 2) = a
    End With
    End Sub 
    You are always very welcome if you add reputation by clicking the * (bottom left) of each message that has helped you.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Trying to write a formula to highlight calls containing a value greater than 50

    Quote Originally Posted by POPSS View Post
    I'm trying to have it identify only 3 digit numbers left of the hyphen that have a value greater than 50 right of the hyphen, if so fill color blue.
    1) Conditional format.
    Select range e.g. A1:A100
    Formula:
    =and(iferror(find("-",a1),0)<5,isnumber(left(a1,find("-",a1&"-")-1)+0),iferror(value(mid(a1,find("-",a1)+1,len(a1))),0)>=50)


    2) vba
    Please Login or Register  to view this content.
    Last edited by jindon; 01-31-2023 at 10:59 PM.

+ 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: 8
    Last Post: 12-15-2020, 11:02 AM
  2. [SOLVED] Formula to compare balances in two columns and highlight if greater then 5000?
    By nimv1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-16-2017, 10:09 PM
  3. [SOLVED] Conditional Formating Highlight Row Greater Than Formula
    By eorydc in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-06-2014, 02:30 PM
  4. Formula to highlight any differences greater than 4%
    By jaaason123 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-08-2013, 08:42 PM
  5. [SOLVED] Formula to highlight cell/data greater than a specific date
    By tdsmith14 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-22-2013, 05:44 AM
  6. [SOLVED] How to write a greater if formula that shows a value?
    By trav2016 in forum Excel General
    Replies: 6
    Last Post: 04-27-2006, 02:10 PM
  7. [SOLVED] How can I write a formula or an argument to highlight a date when.
    By saffield in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-24-2005, 12:06 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