• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

How to highlight a cell if it is greater or less than a column based on its entered data|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / How to highlight a cell if it is greater or less than a column based on its entered data|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosHow to highlight a cell if it is gr…
sp_PrintTopic sp_TopicIcon
How to highlight a cell if it is greater or less than a column based on its entered data
Avatar
A.Maurizio
Member
Members
Level 0
Forum Posts: 202
Member Since:
June 26, 2016
sp_UserOfflineSmall Offline
1
January 26, 2021 - 7:35 pm
sp_Permalink sp_Print

Hello everyone my name is A.Maurizio
First of all, too, with a little delay I would like to wish you all a Happy New Year with Friendship and sympathy.

Having said that, my problem is this.
On a sheet of excel in column (B) I want to insert measurements of Body Weight in KG.

While in the row that goes from the cell (I1: N1) I have entered the achievement of its evaluation ranging from "95.0 Kg" you have "70.0 kg"
Now my difficulty in realizing all this lies in this

If I in column (B) enter the figure (96.0 Kg) in a given cell
I would like that in Cell (I1) the "Interior" color was always the same equal to the Base one; As (96.0 Kg) is getting closer and closer to (100.0 Kg)

On the contrary: If the weight of (95.9 kg) or (95.0 kg) is reported in Column (B)
Cell (I1) should turn purple red.

However, in the event that this threshold is exceeded by column (B)
Cell (I1) should return to having the base color
Since the Cell (J1) should be colored
As we move to a lower weight.

that's all !
I of mine tried to do a little something, but with little positive outcome.
Thanks for all the help you want to give me on this.
Greetings from A.Maurizio

I insert test files

Avatar
Purfleet
England
Member
Members


Trusted Members
Level 4
Forum Posts: 412
Member Since:
December 20, 2019
sp_UserOfflineSmall Offline
2
January 27, 2021 - 7:23 pm
sp_Permalink sp_Print

Rather than VBA cant you use conditional formatting?

If i have understood the requirements correctly, somthing like this

=INDEX($B:$B,MATCH(MAX($A:$A),$A:$A,0))<($I$1-1) (STOP IF TRUE)

=INDEX($B:$B,MATCH(MAX($A:$A),$A:$A,0))<($I$1+1)

Index finds the newest entry, looks up the weight and compares to the cell in I1 - if it within 1 kg it goes red.

i find it quite tricky to get the conditional formatting formula correct, so i think it is easier to do in the worksheet first

Also - please dont use Merged Cells!

Hope it helps

Avatar
A.Maurizio
Member
Members
Level 0
Forum Posts: 202
Member Since:
June 26, 2016
sp_UserOfflineSmall Offline
3
January 28, 2021 - 2:02 am
sp_Permalink sp_Print

Hi Purfleet
First of all, thank you for your little help.
Tried it and I have to say it's perfect.
Now I just have to modify it to make the other numbers ready to do the same thing and that's it.
Infinite Thanks Truly.
Sincere Greetings From A.Maurizio

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Anders Sehlstedt, RAQUEL ACION, Dana Friedt, Chandler Davis, gogy13, Brenda Richards, Mark Luke
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
Jessica Stewart: 202
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Mark Luke
terimeri dooriyan
Jack Aston
AndyC
Denise Lloyd
michael serna
mashal sana
Tiffany Kang
Leah Gillmore
Sopi Yuniarti
Forum Stats:
Groups: 3
Forums: 24
Topics: 6218
Posts: 27267

 

Member Stats:
Guest Posters: 49
Members: 31901
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.