TRC is primarily funded by ad revenue. If you like the content you find here, please do not block our ads. Thank you.
Results 1 to 10 of 10
Like Tree2Likes
  • 1 Post By Lob
  • 1 Post By Lob

Nested IF statements - Excel

Another excel question. Sorry. I have a sheet I am working on for hedgehog drug treatments and want to add an IF statement to apply ...

  1. #1
    Should Get Out More Wreckless Rat's Avatar
    Join Date
    Jan 2008
    Location
    Norfolkshire
    Posts
    17,336
    Liked
    2533 times
    Blog Entries
    1

    Default Nested IF statements - Excel

    Another excel question. Sorry.

    I have a sheet I am working on for hedgehog drug treatments and want to add an IF statement to apply before another if statement but I cant seem to get it working. Help

    Example. Cell F5 checks to see if there is a weight in cell D5 if so, apply the weight/dose formula. But.... I also want it to check cell F2 to see if it contains a YES before doing the calculation or if the cell contains NO do nothing.

    Doe that make sense? I hope so.

    So in F5 I currently have

    =IF(D5="","",D5*0.0008 ) ignore the space I had to add it on here cos of emotes
    Register to join this UK Motorbike Forum, start a motorbike blog, or use our free motorbike classifieds!


  2. TRC is primarily funded by ad revenue. If you like the content you find here, please do not block our ads. Thank you.
  3. #2
    Really Bored burty's Avatar
    Join Date
    Jan 2009
    Location
    Medway Taahns Innit
    Posts
    2,473
    Liked
    217 times
    Blog Entries
    1

    Default Re: Nested IF statements - Excel

    Your logical test needs to include an AND so it becomes:

    =IF(AND(F6="yes",D5="" ),"",D5*0.0008 )
    Register to join this UK Motorbike Forum, start a motorbike blog, or use our free motorbike classifieds!

  4. #3
    Should Get Out More Wreckless Rat's Avatar
    Join Date
    Jan 2008
    Location
    Norfolkshire
    Posts
    17,336
    Liked
    2533 times
    Blog Entries
    1

    Default Re: Nested IF statements - Excel

    Quote Originally Posted by burty View Post
    Your logical test needs to include an AND so it becomes:

    =IF(AND(F6="yes",D5="" ),"",D5*0.0008 )
    That doesn't work either.
    Register to join this UK Motorbike Forum, start a motorbike blog, or use our free motorbike classifieds!

  5. #4
    Should Get Out More
    Join Date
    Dec 2007
    Posts
    9,360
    Liked
    1679 times

    Default Re: Nested IF statements - Excel

    Quote Originally Posted by Wreckless Rat View Post
    That doesn't work either.
    Even if you change it to =IF(AND($F$2="yes",D5="" ),"",D5*0.0008 ) ?
    Register to join this UK Motorbike Forum, start a motorbike blog, or use our free motorbike classifieds!

  6. #5
    Should Get Out More Wreckless Rat's Avatar
    Join Date
    Jan 2008
    Location
    Norfolkshire
    Posts
    17,336
    Liked
    2533 times
    Blog Entries
    1

    Default Re: Nested IF statements - Excel

    Register to join this UK Motorbike Forum, start a motorbike blog, or use our free motorbike classifieds!

  7. #6
    Lob
    Lob is offline
    At Work Lob's Avatar
    Join Date
    Feb 2008
    Location
    Switzerland
    Posts
    1,790
    Liked
    423 times

    Default Re: Nested IF statements - Excel

    =if(f2="yes",if(d5="","",$d$5*0.0008),"")

    You might have to make some additions to force the case into upper text for the check etc but this will do it conditionally on Yes/No
    Register to join this UK Motorbike Forum, start a motorbike blog, or use our free motorbike classifieds!

  8. #7
    Really Bored burty's Avatar
    Join Date
    Jan 2009
    Location
    Medway Taahns Innit
    Posts
    2,473
    Liked
    217 times
    Blog Entries
    1

    Default Re: Nested IF statements - Excel

    Put this into F5 and copy to the other cells:

    =IF(AND(F$2="YES",NOT(D5="")),D5*0.0008,"")

    Sorry, too slow
    Register to join this UK Motorbike Forum, start a motorbike blog, or use our free motorbike classifieds!

  9. #8
    Should Get Out More Wreckless Rat's Avatar
    Join Date
    Jan 2008
    Location
    Norfolkshire
    Posts
    17,336
    Liked
    2533 times
    Blog Entries
    1

    Default Re: Nested IF statements - Excel

    Quote Originally Posted by Lob View Post
    =if(f2="yes",if(d5="","",$d$5*0.000,"")

    You might have to make some additions to force the case into upper text for the check etc but this will do it conditionally on Yes/No
    Now this works, but it kills my conditional format....

    Hmm... a step in the right direction. Thanks

    thanks for the other input too folks, much appreciated. Now I just need to work out why I can't conditionally format the cell with that formula in. hmmm
    Register to join this UK Motorbike Forum, start a motorbike blog, or use our free motorbike classifieds!

  10. #9
    Lob
    Lob is offline
    At Work Lob's Avatar
    Join Date
    Feb 2008
    Location
    Switzerland
    Posts
    1,790
    Liked
    423 times

    Default Re: Nested IF statements - Excel

    your conditional format is for a blank cell. it's no longer blank when it has a value in.

    hth.
    Register to join this UK Motorbike Forum, start a motorbike blog, or use our free motorbike classifieds!

  11. #10
    Should Get Out More Wreckless Rat's Avatar
    Join Date
    Jan 2008
    Location
    Norfolkshire
    Posts
    17,336
    Liked
    2533 times
    Blog Entries
    1

    Default Re: Nested IF statements - Excel

    Couldn't seem to get the conditional formatting to work any more, so I gave up.

    The final version seems to work though, so thanks folks.

    http://hogspital.co.uk/docs/Drug-chart-template%20.xlsx

    This makes it much easier for Miss Wrat and I to work out the jabs.
    Register to join this UK Motorbike Forum, start a motorbike blog, or use our free motorbike classifieds!

Go Back to Forum My Forum