If/Then Formulas

B

Bk Goto

Hello and Good Day =)

I am in need of some help...

I would like to create a formula where
IF cell F7 =1 then E7*1, IF F7=2 then E7*1, IF F7=3, then E7*2

Any help would be appreciated, I know it can be done, but haven't a clue as
to how ;-)

Thanx ~ Bkg.
 
G

Glenn

Bk said:
Hello and Good Day =)

I am in need of some help...

I would like to create a formula where
IF cell F7 =1 then E7*1, IF F7=2 then E7*1, IF F7=3, then E7*2

Any help would be appreciated, I know it can be done, but haven't a clue as
to how ;-)

Thanx ~ Bkg.


=IF(OR(F7=1,F7=2),E7,IF(F7=3,E7*2,"F7 is not 1, 2 or 3"))
 
B

Bk Goto

You are the best!! I knew XL could do it, but I am self taught, and never
had the need for such a formula.

THANK YOU THANK YOU THANK YOU!!!!
 
L

Lars-Åke Aspelin

Hello and Good Day =)

I am in need of some help...

I would like to create a formula where
IF cell F7 =1 then E7*1, IF F7=2 then E7*1, IF F7=3, then E7*2

Any help would be appreciated, I know it can be done, but haven't a clue as
to how ;-)

Thanx ~ Bkg.


Just to add another formula to the collection you have already got:

=E7*(4-3*F7+F7*F7)/2

Shortest so far I guess, but also the least recommended to use because
it is difficult to see through and hard to update when the
requirements change.

Lars-Åke
 
L

Lars-Åke Aspelin

Just to add another formula to the collection you have already got:

=E7*(4-3*F7+F7*F7)/2

Shortest so far I guess, but also the least recommended to use because
it is difficult to see through and hard to update when the
requirements change.

Lars-Åke

Even shorter :)

=E7*(4-3*F7+F7^2)/2

Lars-Åke
 
R

Rick Rothstein \(MVP - VB\)

Nice! Not only is it one shorter than mine... it uses no function calls
either.

Rick
 
R

Rick Rothstein \(MVP - VB\)

LOL... you are going to kick yourself for missing this! One character
shorter...

=E7*(F7=3)+E7

Rick
 
R

Rick Rothstein \(MVP - VB\)

Of course, it is only shorter as long as the Column E address is an address
composed of 2 characters (in the range A1:Z9). If the address is 3
characters long, then the formulas are the same length; and, if the address
is 4 or more characters long, then your form of the formula will be shorter.

Rick
 
J

John C

And if F7 contains no data, every one of these 'shorter solutions' is
incorrect. I will even allow that there is DV allowing only whole numbers
from 1 to 3, but until F7 is populated, every formula will have some output
that will be incorrect.
 

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