Can anyone help me with a formular to give me the following results for the following;
if cell 1 contains a value between 0 and 18 then an "A" result is required.
If cell 1 contains a value betweenl 19 and 26 then a "B" result is requied
if cell 1 contains a value between 27 and 36 then a "C" result is required
and if cell 1 contains a value of greater than 37 then a "D" result is required.
IF(D3>0,D3<=18,A,IF(AND(D3>18,D3<=26,B,IF(AND(D3>27,D3<=36,C,IF(AND(D3>=37,D,)))))))
This doesn't work for me, what am I doing wrong?
First of all put "" around text.
Second: no need for double check...
Formula works as: IF function is TRUE then (something) ELSE (something else)
so...
IF(D3<=18, "A", IF(D3<=26, "B", IF( D3<=36, "C", "D")))
Edit: notice that if number is greater than 18 (i.e. 25) it will go to second IF. Now, don't need to check again is it greater than 18. All you need is to see is it less or equal than 26.
Last edited by zbor; 06-06-2010 at 02:52 AM.
"Relax. What is mind? No matter. What is matter? Never mind!"
Also...
If cell is empty then you'll get A.
If you want to avoid it you can add one more IF
=IF(D3="", "", IF(D3<=18, "A", IF(D3<=26, "B", IF( D3<=36, "C", "D"))))
"Relax. What is mind? No matter. What is matter? Never mind!"
Another way:
=LOOKUP(D3,{0,18,26,36},{"A","B","C","D"})
Again:
=IF(D3="", "", LOOKUP(D3,{0,18,26,36},{"A","B","C","D"}))
Edit. which will give you error for negative results while prior will return A
Last edited by zbor; 06-06-2010 at 03:00 AM.
"Relax. What is mind? No matter. What is matter? Never mind!"
Many thanks Zbor
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks