Excel 2002: How to classify numbers ?

M

Mr. Low

Hi,

Lets consider the folowing table:

A B C D E
1 Invoice Date Amount Days Old Group
2 B21 21.5.09 200 60 C
3 yyy 30 B
15 A
120 D
360 E
450
245
Group defination:
0 < A < 20
20 < B < 35
35 < C < 65
65 < D <135
135 < E

The group classification is a range where the number of days lies.

May I know the formula for cell E2 that enable me to get the answers when
copy downwards ?

Thanks

Low
 
J

Jacob Skaria

In E2 copy the below formula
=LOOKUP(D2,{0,1,20,35,65,135},{"","A","B","C","D","E"})

If this post helps click Yes
 
M

Mr. Low

Hi Jacob,

Thanks for the first formula.

What about the formula with "greater or equal" and "less or equal" as
illustrated below:

Group defination:
0 =< A <= 20
21 =< B <= 35
36 =< C <= 65
66 =< D <=135
136 =< E

Thanks

Low
 
S

Shane Devenshire

Hi,

You can use VLOOKUP as follows:
1. Create a lookup table like this, say in L1:M5 (it looks like you will
need more in your case)
0 A
20 B
35 C
65 D
135 E

In cell E2 enter the formula

=VLOOKUP(D2,L$1:M$5,2)
 
M

Mr. Low

Hi Shane,

I wounder if this formula could only pick up the exact match, it won't pick
up the rage of numbers in accordance with their groupings.

Any idea ?

Thanks

Low
 
J

Jacob Skaria

LOOKUP will take care of that..Now for the below formula there is a change
from your initial conditions...Try and feedback

=IF(C2="","",LOOKUP(C2,{0,21,36,66,136},{"A","B","C","D","E"}))

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top