• 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

Choose tier or level based on input value|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Choose tier or level based on input value|General Excel Questions & Answers|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
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 ForumGeneral Excel Questions & Answe…Choose tier or level based on input…
sp_PrintTopic sp_TopicIcon
Choose tier or level based on input value
Avatar
Ahmad Khalil Che Ab Aziz
Member
Members
Level 0
Forum Posts: 9
Member Since:
June 16, 2015
sp_UserOfflineSmall Offline
1
July 27, 2020 - 2:55 pm
sp_Permalink sp_Print

I try to define range of year of experience by using the formula below in the attached excel. However it does not return the value that I want.

=IF(AND(A2>=0.00, A2<3.00),"'0-3",IF(AND(A2>=3.00, A2<5.00),"'3-5",IF(AND(A2>=5.00,A2<7.00),"'5-7",IF(AND(A2>=7.00,A2<10.00),"'7-10",IF(AND(A2>=10.00, A2<12.00),"'10-12",IF(AND(A2>=12.00, A2<15.00),"'12-15",IF(AND(A2>=15.00,A2<20.00),"'15-20", IF(AND(A2>=20.00, A2<25.00),"'20-25", IF(AND(A2>=25,A2<30.00),"'25-30",IF(A2>=30.00),"'>30"))

What is the reason and how to fix the formula.

Thank you.

sp_AnswersTopicSeeAnswer See Answer
Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1512
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
2
July 27, 2020 - 5:49 pm
sp_Permalink sp_Print

Hi Ahmad,

IF stops evaluating when it finds a True result so you can do away with the AND functions and simplify it to:

=IF(A2<3,"'0-3", IF(A2<5,"'3-5", IF(A2<7,"'5-7", IF(A2<10,"'7-10", IF( A2<12,"'10-12", IF(A2<15,"'12-15", IF(A2<20,"'15-20",  IF(A2<25,"'20-25", IF(A2<30,"'25-30", "'>30")))))))))

 

But a neater solution is to use a lookup like VLOOKUP

=VLOOKUP(A16,$D$3:$E$12,2)

I've included both formulae in the attached workbook.

regards

Phil

sp_AnswersTopicAnswer
Answers Post
Avatar
Ahmad Khalil Che Ab Aziz
Member
Members
Level 0
Forum Posts: 9
Member Since:
June 16, 2015
sp_UserOfflineSmall Offline
3
July 28, 2020 - 11:33 am
sp_Permalink sp_Print

Thank you Philip for the advice on the formula and its alternative.

Question: For VLOOKUP formula, in what scenario that we can leave the range_lookup blank.

Regards

Ahmad Khalil

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1512
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
4
July 28, 2020 - 11:56 am
sp_Permalink sp_Print

Hi Ahmad,

range_lookup defaults to True which means VLOOKUP will look for an approximate match.  This is what you want in this scenario because you are looking up values that fall into ranges.

If you lookup 1.83, VLOOKUP matches the nearest smallest number which is 0.  Obviously if you set it to exact match =VLOOKUP( A16,$D$3:$E$12,2, False) then 1.83 will not be found in your case and you'll get an error.

So, leave out range_lookup when you want an approximate match to the value you are looking up.  Note that you need to have the data being looked up (Col D in this case) sorted into ascending order for this to work properly.

Please read this for more information

https://www.myonlinetraininghu.....-explained

Regards

Phil
 

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Brian Pham, baber Tufail, drsven
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
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
drsven
Annie Witbrod
wahab tunde
Cong Le Duc
Faisal Bashir
Ivica Cvetkovski
Blaine Cox
Shankar Srinivasan
riyepa fdgf
Hannah Cave
Forum Stats:
Groups: 3
Forums: 24
Topics: 6205
Posts: 27211

 

Member Stats:
Guest Posters: 49
Members: 31880
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.