Solved

Looking for Formula that traps a result

Posted on 2016-07-29
5
24 Views
Last Modified: 2016-07-29
EE Pros,

I'm looking for the formula that can trap a result and produce a specific text result.  In other words, if I have 5 stages, stage 1 is between 1 and 20, stage 2 is 21-40, stage 3 is 41-60, stage 4 is 61-80 and stage 5 is 81-100.  When the result, single number, falls within any of these ranges, the appropriate Stage is displayed.

That's it!

Appreciate your help in advance.

B.
0
Comment
Question by:Bright01
  • 3
5 Comments
 
LVL 32

Accepted Solution

by:
Rob Henson earned 500 total points
ID: 41734558
Simple lookup table will do this for you.

Setup a table like below, assume A1 to B5

0      Stage 1
21      Stage 2
41      Stage 3
61      Stage 4
81      Stage 5

Then a vlookup formula:

=VLOOKUP(C8,A1:B5,2)  where C8 is value being looked up.
0
 
LVL 28

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41734567
Or without making lookup table, you can try something like this....

Assuming the number being compared is in A2, then

=IF(AND(A2>0,A2<=100),"Stage "&MATCH(A2,{1,21,41,61,81}),"")

Open in new window

0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 41734568
Full syntax for VLOOKUP is

=VLOOKUP(LookupValue, LookupRange, Offset, LookupType)

LookupValue - the value being searched for,
LookupRange - the data in which it is being looked for with the lookup value in the leftmost column,
Offset - the column from which the result is required
LookupType - Options are True (or 1), False (or 0) or omitted. Choosing False will look for an exact match of the LookupValue, if not found it will return an error. Choosing True will look for the closest match that is not greater than the LookupValue and relies on the reference column being in ascending order. Omitting this parameter has the same effect as choosing True.
0
 

Author Closing Comment

by:Bright01
ID: 41734572
Rob,

Much thanks!  Works great!

B.
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 41734573
Or also without Lookup table:

="Stage " &CEILING(C8,20)/20

CEILING will round a number up to a specified factor, in this case 20; dividing by 20 then gives the stage number.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now