Solved

Excel Formula question

Posted on 2014-03-26
5
231 Views
Last Modified: 2014-03-26
I recently posted a question about needing an excel formula and the answers I recieved were a solution to the exact question I asked. Then once I went to implement it I realized I mis-worded my question..
My orginal question:
I have a worksheet I am tring to add a column to in G and what I want is as follows.

If C2 is greater than E2 and less than F2 I want G2 to be 1 but if C2 is Less than E2 or Greater than F2 by on 2-5 then G2 will be 2 but if C2 is Less than E2 or greater than F2 by 5 or more the make G2 a value of 3.

is this possible?


and the answers are as follows:
=if(and(c2>E2,c2<f2),1,if(min(e2-c2,c2-f2)>5,3,2)

=IF(AND(C2>E2,C2<F2),1,IF(OR(C2<E2,(C2-F2)>2,(C2-F2)<5),2,IF(OR(C2<E2,(C2-F2)>5),3)))

=IF(AND(C2>E2,C2<F2),1,IF(OR(C2<E2,AND(C2>F2+2,C2<=F2+5)),2,IF(OR(C2<E2,AND(C2>F2+5)),3,"")))


The mis-word came from me saying if C2 is less than E2 or greater than F2 by 2 - 5...

what I meant is that cell C2 is a value and if the value in C2 is less than the value of E2 by 2 - 5 then I want a 2 in G2 or if the value in C2 is less than E2 by more than 5 or the value is greater than F2 by more than 5 then make G2 a value of 3..

I hope this helps. I have already accepted the solution on my other question because my original question the way it was worded was answered correctly.

So for example if the value of C2 is 80 and the value of E2 is 75 and the value of F2 is 85 then I would want the value of G2 to be 1

but if the value of C2 was 73 or 87 then I would want the value of G2 to be 2

and if the value of C2 was 70 or 90 then the value would be 3 in G2

can this be done?
0
Comment
Question by:jlcannon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 500 total points
ID: 39956972
This formula should do it

=IF(AND(C2>E2-5,C2<=E2-2),2,IF(OR(C2<=E2-5,C2>=F2+5),3,1))

Thomas
0
 
LVL 39

Expert Comment

by:nutsch
ID: 39956978
Why should 87 return a value of 2, since  C2 is not less than the value of E2 by 2 - 5.

Thomas
0
 

Author Comment

by:jlcannon
ID: 39957209
because it is 2 higher than F2..

I have created a formula that works based on your answer, thank you

=IF(AND(C2>=E2,C2<=F2),1,IF(AND(C2>=(E2*0.95),C2<=(F2*1.05)),2,3))

useing a percentage of the original number to determine the 1 2 or 3 since some values will be like 87 andsome will be 8000 and a hard factor of 2 - 5 or greater than 5 really isnt that big of a deal with a number like 8000 so a percentage of the value is the way to go.
0
 

Author Closing Comment

by:jlcannon
ID: 39957212
thank you for the help and getting me to my final answer.
0
 
LVL 39

Expert Comment

by:nutsch
ID: 39957220
Glad to help.

Thomas
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

739 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