Solved

Excel formula

Posted on 2014-03-26
4
175 Views
Last Modified: 2014-03-26
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
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
4 Comments
 
LVL 43

Assisted Solution

by:Saqib Husain, Syed
Saqib Husain, Syed earned 167 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

by:Naresh Patel
Naresh Patel earned 166 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

by:
Rgonzo1971 earned 167 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,"")))

Open in new window

Regards
0
 

Author Closing Comment

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

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

634 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