+ Reply to Thread
Results 1 to 12 of 12

Combine two IF statements

Hybrid View

dpask Combine two IF statements 11-29-2011, 11:48 AM
MarvinP Re: Help on combining two IF... 11-29-2011, 11:55 AM
dpask Re: Help on combining two IF... 11-29-2011, 11:58 AM
MarvinP Re: Help on combining two IF... 11-29-2011, 12:07 PM
dpask Re: Help on combining two IF... 11-29-2011, 12:13 PM
MarvinP Re: Help on combining two IF... 11-29-2011, 12:17 PM
Fotis1991 Re: Help on combining two IF... 11-29-2011, 12:40 PM
dpask Re: Help on combining two IF... 11-29-2011, 12:53 PM
MarvinP Re: Combine two IF statements 11-29-2011, 02:07 PM
dpask Re: Combine two IF statements 11-29-2011, 02:49 PM
ffffloyd Re: Combine two IF statements 11-29-2011, 09:29 PM
eha Re: Combine two IF statements 12-07-2011, 04:41 PM
  1. #1
    Registered User
    Join Date
    11-29-2011
    Location
    Halifax, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Combine two IF statements

    Hello,

    I am looking for help on how to combine these two IF statements in one cell. What I need them to do is if the premium in Cell B35 or B38 is less than B42, then the premium listed in B42 will display, but if B35 or B38 is greater than B42, then the premium in either B35 or B38 will display.

    =IF(B35<B42,B42,B35)
    =IF(B38<B42,B42,B38)

    Can someone help?
    Thx, D.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,333

    Re: Help on combining two IF statements

    Hi dpask and welcome to the forum,

    What if B35 is less than B42 and B38 is greater than B42? What happens then? Also if the second condition is true then do you want to return the greater of B35 and B38?

    I think you need to work on the logic a little.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    11-29-2011
    Location
    Halifax, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help on combining two IF statements

    B35 and B38 are options and only one can be chosen.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,333

    Re: Help on combining two IF statements

    Hi,

    I guess I need a sample file to understand the problem. To attach a sample, click on "Go Advanced" and then the Paper Clip Icon above the advanced message area.

  5. #5
    Registered User
    Join Date
    11-29-2011
    Location
    Halifax, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help on combining two IF statements

    Hi,

    I've tagged a comment to where I need the correction to the formula.

    Thx,
    D.
    Attached Files Attached Files

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,333

    Re: Help on combining two IF statements

    I'm still lost !!

    Maybe one of the smart guru's can jump in here and help.

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Help on combining two IF statements

    Ηι

    Maybe one of the smart guru's can jump in here and help
    .

    Marvin
    Sure i am not smarter than you.

    I make an efford, explain to dpask(using example), that something is going wrong, with the conditionss of his formula.

    So dpask, take a look to the attachemant and explain to us....

    Regards
    Attached Files Attached Files
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  8. #8
    Registered User
    Join Date
    11-29-2011
    Location
    Halifax, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help on combining two IF statements

    A35 & A38 are drop down lists and when one is chosen, a premium will list in B35 or B38 (only one can be chosen). Once one is selected, if it is less than the premium calculated in B42, then the premium in B42 should be shown. If the premium selected is greater than that shown in B42, then the premium shown in either B35 or B38 should be displayed. Does this clarify? I've attached the worksheet again with premium showing, hopefully it helps.
    Attached Files Attached Files

  9. #9
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,333

    Re: Combine two IF statements

    Hi dpask,

    I've created an Event Macro behind you sheet1 that will do what you discribe above. See if this helps you with a better answer. Click in A35 or A38 and change the values and it will zero out the other. Then you might do the problem. See attached with VBA code.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    11-29-2011
    Location
    Halifax, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Combine two IF statements

    Hi MarvinP,

    Thank you, I appreciate your help, but it's not working. It does in the case for option A38, however not if option A35 is chosen. I was hoping that it was a just an IF function because I need to apply the formula to two other sheets. I don't really know much about macros.
    Thx.
    D

  11. #11
    Valued Forum Contributor ffffloyd's Avatar
    Join Date
    05-20-2008
    Location
    Perth, WA, Australia
    MS-Off Ver
    Office 365
    Posts
    249

    Re: Combine two IF statements

    Do you just want the maximum value from B35, B38 and B42?
    =MAX(B35,B38,B42)
    _______________
    Floyd Emerson
    Business Intelligence Consultant
    Perth, Western Australia

  12. #12
    Registered User
    Join Date
    12-07-2011
    Location
    Norway
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Combine two IF statements

    Or if you want to use IF statements you can use this
    =IF(AND(B35<B42;B38<B42);B42;IF(B38<B35;B35;B38))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1