Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

Excel formula

Posted on 2014-03-26
Medium Priority
176 Views
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?
0
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

LVL 43

Assisted Solution

Saqib Husain, Syed earned 668 total points
ID: 39956689
Try

=if(and(c2>E2,c2<f2),1,if(min(e2-c2,c2-f2)>5,3,2)
0

LVL 8

Assisted Solution

Naresh Patel earned 664 total points
ID: 39956696
=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)))
0

LVL 52

Accepted Solution

Rgonzo1971 earned 668 total points
ID: 39956702
Hi,

pls try
``````=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,"")))
``````
Regards
0

Author Closing Comment

ID: 39956828
All 3 solutions worked idenicaly and i thank you for all the effort.
0

Featured Post

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month5 days, 18 hours left to enroll