#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mae Mae is offline
external usenet poster
 
Posts: 5
Default If then else

Basically, I am trying to create an if then else statement in Excel and I
have no idea how to do it. What I am trying to achieve is...

IF ( K2 between 8 and 14 ) THEN
((K2 -7) * .05)
ELSE IF
(K2 = 15 ) THEN
(((K2 - 14) *.07) + .30)
ELSE
( K2 * .0 )

Can anyone help me on this???

Thank you!
MAE
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,365
Default If then else

I believe this will do it for you:
=IF(AND(K28,K2<14),(K2-7)*0.05,IF(K2=15,((K2-14)*0.07)+0.3,K2*0))

However, that last (K2 * .0) is always going to be zero, a typo I presume?

Also the initial test for K2 is greater than 8 and less than 14, so 8 and 14
are excluded, use =8 along with <=14 if you need to include 8 and 14.

Hope this helps.

"MAE" wrote:

Basically, I am trying to create an if then else statement in Excel and I
have no idea how to do it. What I am trying to achieve is...

IF ( K2 between 8 and 14 ) THEN
((K2 -7) * .05)
ELSE IF
(K2 = 15 ) THEN
(((K2 - 14) *.07) + .30)
ELSE
( K2 * .0 )

Can anyone help me on this???

Thank you!
MAE

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default If then else

Hi,

You structured you question as if it was VB but posted in worksheet
functions so here's a worksheet one for you to try

=IF(AND(K28,K2<15),(K2-7)*0.05,IF(K2=15,((K2-14)*0.07)+0.3,0))

Mike

"MAE" wrote:

Basically, I am trying to create an if then else statement in Excel and I
have no idea how to do it. What I am trying to achieve is...

IF ( K2 between 8 and 14 ) THEN
((K2 -7) * .05)
ELSE IF
(K2 = 15 ) THEN
(((K2 - 14) *.07) + .30)
ELSE
( K2 * .0 )

Can anyone help me on this???

Thank you!
MAE

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"