Results 1 to 10 of 10

Thread: IF with two conditions
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Mar 2011
    Location
    Saudi Arabia
    Posts
    212
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default IF with two conditions

    Hi

    I need formula with if command in column E based on data from A to D, Secondary no Discount

    Segment Transmission Value Discount % Result
    Primary AUTO 1000 20% 200
    Primary
    MANUAL 1000 10% 100
    Secondary AUTO 1000 0% 0
    Secondary
    MANUAL 1000 0% 0

    Thanks in advance

  2. #2
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    41,396
    Post Thanks / Like
    Mentioned
    100 Post(s)
    Tagged
    21 Thread(s)

    Default Re: IF with two conditions

    Why do you need an IF statement at all?

    Excel 2016
    ABCDE
    1SegmentTransmissionValueDiscount %Result
    2PrimaryAUTO100020%200
    3PrimaryMANUAL100010%100
    4SecondaryAUTO10000%0
    5SecondaryMANUAL10000%0

    Discount



    Worksheet Formulas
    CellFormula
    E2=D2*C2

    Hope this helps, good luck.
    Peter
    Excel 365 - Windows 10
    - Want to help your helpers by posting a small, copyable, screen shot directly in your post? Look here
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the # key in the Reply window
    - Read: Forum Rules, Forum Use Guidelines, & FAQ

  3. #3
    Board Regular
    Join Date
    Mar 2011
    Location
    Saudi Arabia
    Posts
    212
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: IF with two conditions

    because column D is given as a sample to understand I have only 1st 3 columns with a fixed discount percentages

  4. #4
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    41,396
    Post Thanks / Like
    Mentioned
    100 Post(s)
    Tagged
    21 Thread(s)

    Default Re: IF with two conditions

    Quote Originally Posted by Salamullah View Post
    because column D is given as a sample to understand I have only 1st 3 columns with a fixed discount percentages
    Hmm, you originally said "command in column E based on data from A to D" so it certainly sounded like column D had data.

    So try this then

    Discount

     ABCDE
    1SegmentTransmissionValueDiscount %Result
    2PrimaryAUTO100020%200
    3PrimaryMANUAL100010%100
    4SecondaryAUTO10000%0
    5SecondaryMANUAL10000%0
    6     

    Spreadsheet Formulas
    CellFormula
    D2=IF(A2="Secondary",0,IF(B2="Auto",20%,10%))
    E2=D2*C2


    Excel tables to the web >> Excel Jeanie HTML 4
    Hope this helps, good luck.
    Peter
    Excel 365 - Windows 10
    - Want to help your helpers by posting a small, copyable, screen shot directly in your post? Look here
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the # key in the Reply window
    - Read: Forum Rules, Forum Use Guidelines, & FAQ

  5. #5
    Board Regular
    Join Date
    Jan 2009
    Location
    uk bexhill sussex
    Posts
    1,656
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: IF with two conditions

    like this perhaps

    =IF(A2="secondary",C2,D2*C2)

    Dave
    Some one always knows more than me,thats why I am here.

  6. #6
    Board Regular
    Join Date
    Mar 2011
    Location
    Saudi Arabia
    Posts
    212
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: IF with two conditions

    Hi thanks its working,

    Can I request to add 1 more condition in the formula, column inserted in C "Source", if Imported than zero % discount

  7. #7
    Board Regular
    Join Date
    Mar 2011
    Location
    Saudi Arabia
    Posts
    212
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: IF with two conditions

    Segment Transmission Source Value Discount % Result
    Primary AUTO Loc 1000 20% 200
    Primary MANUAL Loc 1000 10% 100
    Primary AUTO Imp 1000 20% 0
    Secondary AUTO Imp 1000 0% 0
    Secondary MANUAL Loc 1000 0% 0

  8. #8
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    41,396
    Post Thanks / Like
    Mentioned
    100 Post(s)
    Tagged
    21 Thread(s)

    Default Re: IF with two conditions

    Quote Originally Posted by Salamullah View Post
    Can I request to add 1 more condition in the formula, column inserted in C "Source", if Imported than zero % discount
    Quote Originally Posted by Salamullah View Post
    Segment Transmission Source Value Discount % Result
    Primary AUTO Loc 1000 20% 200
    Primary MANUAL Loc 1000 10% 100
    Primary AUTO Imp 1000 20% 0
    Secondary AUTO Imp 1000 0% 0
    Secondary MANUAL Loc 1000 0% 0
    In that case, shouldn't that red 20% be 0%?

    Discount (2)

    ABCDEF
    1SegmentTransmissionSourceValueDiscount %Result
    2PrimaryAUTOLoc100020%200
    3PrimaryMANUALLoc100010%100
    4PrimaryAUTOImp10000%0
    5SecondaryAUTOImp10000%0
    6SecondaryMANUALLoc10000%0

    Spreadsheet Formulas
    CellFormula
    E2=IF(OR(A2="Secondary",C2 = "Imp"),0,IF(B2="Auto",20%,10%))
    F2=D2*E2


    Excel tables to the web >> Excel Jeanie HTML 4
    Hope this helps, good luck.
    Peter
    Excel 365 - Windows 10
    - Want to help your helpers by posting a small, copyable, screen shot directly in your post? Look here
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the # key in the Reply window
    - Read: Forum Rules, Forum Use Guidelines, & FAQ

  9. #9
    Board Regular
    Join Date
    Mar 2011
    Location
    Saudi Arabia
    Posts
    212
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: IF with two conditions

    Yes correct and thanks for the quick solution

  10. #10
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    41,396
    Post Thanks / Like
    Mentioned
    100 Post(s)
    Tagged
    21 Thread(s)

    Default Re: IF with two conditions

    Quote Originally Posted by Salamullah View Post
    Yes correct and thanks for the quick solution
    Cheers. You're welcome.
    Hope this helps, good luck.
    Peter
    Excel 365 - Windows 10
    - Want to help your helpers by posting a small, copyable, screen shot directly in your post? Look here
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the # key in the Reply window
    - Read: Forum Rules, Forum Use Guidelines, & FAQ

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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