+ Reply to Thread
Results 1 to 9 of 9

Help in using If AND OR conditions in the formula

  1. #1
    Registered User
    Join Date
    05-04-2014
    Location
    Dubai
    MS-Off Ver
    Excel 2013
    Posts
    11

    Help in using If AND OR conditions in the formula

    Hi,

    I am having trouble with formulas below, when i try to use AND, OR, i having trouble . i need the below formulas to be one formula kindly help.


    =IF(B1=SG,IF(A1="I",0,IF(A1="A",0,IF(A1="P",0,IF(A1="D",0,IF(A1="W",0,IF(A1="O",0,IF(A1="B",0,IF(A1="AQ",0,IF(A1="C",0,))))))))))
    =IF(B1=LQT,IF(A1="I",150,IF(A1="A",150,IF(A1="P",150,IF(A1="D",44,IF(A1="W",44,IF(A1="O",44,IF(A1="B",0,IF(A1="AQ",0,IF(A1="C",0,))))))))))
    =IF(B1=MLT,IF(A1="I",151,IF(A1="A",151,IF(A1="P",151,IF(A1="D",0,IF(A1="W",0,IF(A1="O",0,IF(A1="B",0,IF(A1="AQ",0,IF(A1="C",0,))))))))))
    =IF(B1=IBW,IF(A1="I",151,IF(A1="A",151,IF(A1="P",151,IF(A1="D",10+(C2*15%),IF(A1="W",0,IF(A1="O",0,IF(A1="B",0,IF(A1="AQ",0,IF(A1="C",0,))))))))))
    =IF(B1=JL,IF(A1="I",151,IF(A1="A",151,IF(A1="P",151,IF(A1="D",0,IF(A1="W",0,IF(A1="O",0,IF(A1="B",0,IF(A1="AQ",0,IF(A1="C",0,))))))))))

    Thanks in Advance.

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Help in using If AND OR conditions in the formula

    What are you trying to do with this long formula. Can't you simply using a VLOOKUP or something?

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Help in using If AND OR conditions in the formula

    1) In that first statement the result is 0 if B1=SG and A1 is one of A P D W O B AQ or C.
    You have no final value if all the above fails so the result will ALSO be 0
    Therefore the entire statement is equivalent to IF(B1=SG,0,0) which doesnt sound correct.

    2) Shouldnt those B1 test values be in quotes or are they defined names?
    Last edited by Special-K; 06-19-2014 at 06:20 AM.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Registered User
    Join Date
    05-04-2014
    Location
    Dubai
    MS-Off Ver
    Excel 2013
    Posts
    11

    Re: Help in using If AND OR conditions in the formula

    Hi,

    @haripopuri
    I have no idea in using VLOOKUP

    @Special-K
    1)Yes I need SG to be zero and if the B1 is SG the the display should be zero.
    2)B1 values are names hence in quotes.

    just to give u a understanding if B1 is SG then the values are zero, and if B1 is LQT/IBW/JL/xyz then it should check A1 and as per the values of the A1 the results should be the output.

    The reason i am using zeros for SG is in case if i need to use some values in future.

    basacily if A1 is I or A or P or D or W or O or B or AQ or C and B1 is SG then I = 0, A = 0, P=0, D=0, W=0, O=0, B=0, AQ=0, C=0 or B1 is LQT then I = 150, A = 150, P=150, D=44, W=44, O=44, B=0, AQ=0, C=0 or if B1 is MLTW then I = 151, A = 151, P=151, D=0, W=0, O=0, B=0, AQ=0, C=0 or if B1 is IBW then I = 0, A = 0, P=0, D=10+(d3*15%), W=0, O=0, B=0, AQ=0, C=0 or if B1 is JL then I = 151, A = 151, P=151, D=0, W=0, O=0, B=0, AQ=0, C=0

  5. #5
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Help in using If AND OR conditions in the formula

    Hi,

    Can u post a workbook with sample data ? (remove sensitive information)
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Help in using If AND OR conditions in the formula

    Here is a different approach that would use INDEX/MATCH. I created a small table....

    B
    C
    D
    E
    F
    G
    15
    SG LQT MLT IBW JL
    16
    I
    0
    150
    151
    151
    151
    17
    A
    0
    150
    151
    151
    151
    18
    P
    0
    150
    151
    151
    151
    19
    D
    0
    44
    0
    10+(c2*15&)
    0
    20
    W
    0
    44
    0
    0
    0
    21
    O
    0
    44
    0
    0
    0
    22
    B
    0
    0
    0
    0
    0
    23
    AQ
    0
    0
    0
    0
    0
    24
    C
    0
    0
    0
    0
    0


    =INDEX($C$16:$G$24,MATCH(B1,$B$16:$B$24,0),MATCH(A1,$C$15:$G$15,0))

    for F19 (10+(c2*15%) ) instead of just C2, use =C2
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Registered User
    Join Date
    05-04-2014
    Location
    Dubai
    MS-Off Ver
    Excel 2013
    Posts
    11

    Re: Help in using If AND OR conditions in the formula

    Dear Saarang84

    I have attached a sample hope you understand the requirement

    i am trying to use this formula i thig i am execeeding the if Conditions.
    Attached Files Attached Files

  8. #8
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Help in using If AND OR conditions in the formula

    Hi,

    Welcome to the Forum.

    Can u explain briefly what you are trying / want to achieve through these formulas in column G and J in your attachment?

    If you can give us information about the different types of codes used in Status and Sub-con columns, we can code the formula better instead of your Frankenstein IF formula.

  9. #9
    Registered User
    Join Date
    05-04-2014
    Location
    Dubai
    MS-Off Ver
    Excel 2013
    Posts
    11

    Re: Help in using If AND OR conditions in the formula

    Hi Saarang,

    I do agree that their is a better way than my Frankenstein 😁, anyways jokes apart, I will list what each column contains and what is that I want.

    First I use this to manage my projects, now

    Columns

    - C is Qty
    - D I need to take 15% of the value in calculation if Columns E Has D
    - F is where for project status like (C for complete, IP for in progress, H for Hold)
    - G is my price what I get ( as per values in columns E
    - H is my invoice values (i.e. G*C, if E is D then G*C+(d*15%))
    - I is my sub contractor diffrent companies do diffrent services and my rates are different wit each of them as per their services, i keep adding ne sub cos with different pricing structure.
    - J is their price
    -K is J*C and if required d*x% i.e. J*C+(D*15)


    The reason I need zero in column J if Column I is SG as I am myself doing the service so no price in J


    Their are even more columns in the actual sheet before c and subcon.
    Now if you see the formula listed.

    Now in the sheet as u can see in J3 the price structure & in Column G

    If their is a better way to do do let me know


    Sent from my RM-821_im_mea3_306 using Tapatalk

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Need formula with Several conditions
    By rejcor in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-03-2014, 07:27 AM
  2. SUM IF formula with conditions
    By lindafinlay in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-12-2013, 11:52 PM
  3. Formula with 3 conditions
    By Yoona in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-16-2013, 05:14 AM
  4. [SOLVED] Look UP formula for 2 and 3 conditions
    By Excel Dumbo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-02-2013, 09:48 PM
  5. [SOLVED] How to add 2 conditions to a Formula or modify existing formula
    By Frank121977 in forum Excel General
    Replies: 9
    Last Post: 12-22-2012, 03:13 PM

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