Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 133
Default if statement in formula

is it possible to do this:

D2 = A2 * if(B1= "1/4 points", A2/4, if(B2="1/8 points", A2/8)) * A3

a b c d
1 LENGTH POSITION HEIGHT ANSWER
2 12 "1/4 points" 24 864
3 12 "1/8 points" 24 432

with my if statement... to avoid writing my formula 3 times... this is a
hugely simplified formula - the actual one is several lines long, and i'd
like to minimize code.
thanks,
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,420
Default if statement in formula

This works for me

= A2*IF(B2="1/4 points",A2/4,IF(B2="1/8 points",A2/8))*A2

although it is half the number that you show


--
__________________________________
HTH

Bob

"Derrick" wrote in message
...
is it possible to do this:

D2 = A2 * if(B1= "1/4 points", A2/4, if(B2="1/8 points", A2/8)) * A3

a b c d
1 LENGTH POSITION HEIGHT ANSWER
2 12 "1/4 points" 24 864
3 12 "1/8 points" 24 432

with my if statement... to avoid writing my formula 3 times... this is a
hugely simplified formula - the actual one is several lines long, and i'd
like to minimize code.
thanks,



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default if statement in formula

While that is a valid formula, if you're dealing with multiple text values
which already contain the number you want, why not do this:

=C2*A2*A2/MID(B2,FIND("/",B2)+1,FIND(" ",B2)-FIND("/",B2)-1)

I'm assuming you wanted to multiply by height (C2) and not A3. Note that you
could now copy this down, and you don't have to worry about all the different
fractions you might have.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Derrick" wrote:

is it possible to do this:

D2 = A2 * if(B1= "1/4 points", A2/4, if(B2="1/8 points", A2/8)) * A3

a b c d
1 LENGTH POSITION HEIGHT ANSWER
2 12 "1/4 points" 24 864
3 12 "1/8 points" 24 432

with my if statement... to avoid writing my formula 3 times... this is a
hugely simplified formula - the actual one is several lines long, and i'd
like to minimize code.
thanks,

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 133
Default if statement in formula

luke, thanks for the input - actually, these are text values are from a
validated list, so there's not going to be any variance.. so it will be
easier in the long run... i wont have to look for '1/2.455 points' or
anything like that

"Luke M" wrote:

While that is a valid formula, if you're dealing with multiple text values
which already contain the number you want, why not do this:

=C2*A2*A2/MID(B2,FIND("/",B2)+1,FIND(" ",B2)-FIND("/",B2)-1)

I'm assuming you wanted to multiply by height (C2) and not A3. Note that you
could now copy this down, and you don't have to worry about all the different
fractions you might have.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Derrick" wrote:

is it possible to do this:

D2 = A2 * if(B1= "1/4 points", A2/4, if(B2="1/8 points", A2/8)) * A3

a b c d
1 LENGTH POSITION HEIGHT ANSWER
2 12 "1/4 points" 24 864
3 12 "1/8 points" 24 432

with my if statement... to avoid writing my formula 3 times... this is a
hugely simplified formula - the actual one is several lines long, and i'd
like to minimize code.
thanks,

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 133
Default if statement in formula

ok thanks!
whoops. i made a mistake in writing the formula.. lol the last *A2 should be
*C2... which would explain ur half of my answer.
for some reason i was getting an error when doing my formula, so now that i
know it works, i'll go through it and look.


"Bob Phillips" wrote:

This works for me

= A2*IF(B2="1/4 points",A2/4,IF(B2="1/8 points",A2/8))*A2

although it is half the number that you show


--
__________________________________
HTH

Bob

"Derrick" wrote in message
...
is it possible to do this:

D2 = A2 * if(B1= "1/4 points", A2/4, if(B2="1/8 points", A2/8)) * A3

a b c d
1 LENGTH POSITION HEIGHT ANSWER
2 12 "1/4 points" 24 864
3 12 "1/8 points" 24 432

with my if statement... to avoid writing my formula 3 times... this is a
hugely simplified formula - the actual one is several lines long, and i'd
like to minimize code.
thanks,






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default if statement in formula

Ok, thanks for response. You basic formula structure is okay then, just need
to swap the A3 reference out to:

=A2*IF(B2="1/4 points",A2/4,IF(B2="1/8 points",A2/8))*C2
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Derrick" wrote:

luke, thanks for the input - actually, these are text values are from a
validated list, so there's not going to be any variance.. so it will be
easier in the long run... i wont have to look for '1/2.455 points' or
anything like that

"Luke M" wrote:

While that is a valid formula, if you're dealing with multiple text values
which already contain the number you want, why not do this:

=C2*A2*A2/MID(B2,FIND("/",B2)+1,FIND(" ",B2)-FIND("/",B2)-1)

I'm assuming you wanted to multiply by height (C2) and not A3. Note that you
could now copy this down, and you don't have to worry about all the different
fractions you might have.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Derrick" wrote:

is it possible to do this:

D2 = A2 * if(B1= "1/4 points", A2/4, if(B2="1/8 points", A2/8)) * A3

a b c d
1 LENGTH POSITION HEIGHT ANSWER
2 12 "1/4 points" 24 864
3 12 "1/8 points" 24 432

with my if statement... to avoid writing my formula 3 times... this is a
hugely simplified formula - the actual one is several lines long, and i'd
like to minimize code.
thanks,

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default if statement in formula

TRY

=A2^2/(IF(B2="1/4 points",4,IF(B2="1/8 points",8)))*C2

If this post helps click Yes
---------------
Jacob Skaria


"Derrick" wrote:

is it possible to do this:

D2 = A2 * if(B1= "1/4 points", A2/4, if(B2="1/8 points", A2/8)) * A3

a b c d
1 LENGTH POSITION HEIGHT ANSWER
2 12 "1/4 points" 24 864
3 12 "1/8 points" 24 432

with my if statement... to avoid writing my formula 3 times... this is a
hugely simplified formula - the actual one is several lines long, and i'd
like to minimize code.
thanks,

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 133
Default if statement in formula

Jacob-
thanks, and that would work, but the goal was to know if having an if
statment would work - the formula below was a simplified example of one im
working on. so, albeit shorter, quite unneccessary lol.

Thanks

"Jacob Skaria" wrote:

TRY

=A2^2/(IF(B2="1/4 points",4,IF(B2="1/8 points",8)))*C2

If this post helps click Yes
---------------
Jacob Skaria


"Derrick" wrote:

is it possible to do this:

D2 = A2 * if(B1= "1/4 points", A2/4, if(B2="1/8 points", A2/8)) * A3

a b c d
1 LENGTH POSITION HEIGHT ANSWER
2 12 "1/4 points" 24 864
3 12 "1/8 points" 24 432

with my if statement... to avoid writing my formula 3 times... this is a
hugely simplified formula - the actual one is several lines long, and i'd
like to minimize code.
thanks,

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with if-then statement in formula mcmilja Excel Discussion (Misc queries) 6 April 20th 08 06:09 PM
IF statement formula JaB Excel Worksheet Functions 4 September 15th 06 04:12 PM
Can I use IF statement with a formula? Michael NYC Excel Worksheet Functions 1 October 1st 05 04:45 AM
if statement formula Marlis Excel Discussion (Misc queries) 2 August 17th 05 04:57 AM
If statement formula lintan Excel Worksheet Functions 6 November 22nd 04 10:29 PM


All times are GMT +1. The time now is 12:18 AM.

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"