+ Reply to Thread
Results 1 to 14 of 14

More than 1 TRUE value in and IF formula

  1. #1
    Registered User
    Join Date
    07-10-2014
    Location
    Belgium
    MS-Off Ver
    2010
    Posts
    15

    More than 1 TRUE value in and IF formula

    Hi,

    I want to try this:
    +IF(MID(B9;3;4)="P01E","P02E","P09E");$B$87)

    So if it's P01E or P02E or P09E: in all 3 cases it should refer to the B87 cel.

    Hopefully my question is clear.

    Thanks in advance,
    Last edited by Teddymanne; 07-11-2014 at 01:36 PM.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: More than 1 TRUE value in and IF formula

    Try

    =IF(OR(MID(B9;3;4)={"P01E";"P02E";"P09E"});$B$87)

  3. #3
    Registered User
    Join Date
    07-10-2014
    Location
    Belgium
    MS-Off Ver
    2010
    Posts
    15

    Re: More than 1 TRUE value in and IF formula

    Thanks man, it seems like it worked out with the brackets!

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: More than 1 TRUE value in and IF formula

    You're welcome.

  5. #5
    Registered User
    Join Date
    07-10-2014
    Location
    Belgium
    MS-Off Ver
    2010
    Posts
    15

    Re: More than 1 TRUE value in and IF formula

    And how could I do this?: I want my price to be +0,89€ when it's P02E, P09E or P01E BUT when it's for example P46E, P37E, P08E... (every other number that's not P01E, P09E or P01E) I want it + 1,19€

    Thanks in advance

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: More than 1 TRUE value in and IF formula

    Try
    =IF(OR(MID(B9;3;4)={"P01E";"P02E";"P09E"});$B$87+0,89;$B$87+1,19)

  7. #7
    Registered User
    Join Date
    07-10-2014
    Location
    Belgium
    MS-Off Ver
    2010
    Posts
    15

    Re: More than 1 TRUE value in and IF formula

    No, that won't work because I have other options, for example N09E + 2,50€.

    So if the first didget is 'P' and the last is 'E' and the middle ones are '01', '02' or '09' it should be +0,89€, in any other case (2 middle digits are not one of those 3 but first and last stays 'P' and 'E' it should be +1,19€.

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: More than 1 TRUE value in and IF formula

    I would build a table to translate the code to the value..

    Say E1:F6

    E1:E6 = P01E P02E P09E N01E N02E N09E
    F1:F6 = 0,89 0,89 0,89 1,19 1,19 1,19

    Then use

    =VLOOKUP(MID(B9;3;4);$E$1:$F$6;2;FALSE)*$B$87

  9. #9
    Registered User
    Join Date
    07-10-2014
    Location
    Belgium
    MS-Off Ver
    2010
    Posts
    15

    Re: More than 1 TRUE value in and IF formula

    If tried this:
    +IF(MID(B9;3;1)="P";IF(MID(B9;6;1)="E";IF(MID(B9;4;2)={"01";"02";"09"};B87;B88)))

    But it's not working, when the two middle digits are for example "02"; it refers to B88 instead of B87, what did I do wrong?

  10. #10
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: More than 1 TRUE value in and IF formula

    The original formula should be just fine, just add the B88 for the FALSE part..

    =IF(OR(MID(B9;3;4)={"P01E";"P02E";"P09E"});$B$87;$B$88)



    And you forgot the OR part in your attempt above...

  11. #11
    Registered User
    Join Date
    07-10-2014
    Location
    Belgium
    MS-Off Ver
    2010
    Posts
    15

    Re: More than 1 TRUE value in and IF formula

    No, that won't work because if I have now for example a N09E or an A00B it will also give me the B88 value, there are a lot of options.

  12. #12
    Registered User
    Join Date
    07-10-2014
    Location
    Belgium
    MS-Off Ver
    2010
    Posts
    15

    Re: More than 1 TRUE value in and IF formula

    The strange thing is my formula works only with the "01" and for the "02" and "09" he gives me the B88 value.

    EDIT: now it worked, I forgot to add the OR command in my function. Many thanks for your help, I hope I can advance right now.
    Last edited by Teddymanne; 07-10-2014 at 02:48 PM.

  13. #13
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: More than 1 TRUE value in and IF formula

    I'll repeat post #8 then.

    build a table with all the possible values of MID(B9;3;4) in one column, and the corresponding values in the column to the right.
    And use Vlookup.

  14. #14
    Registered User
    Join Date
    07-10-2014
    Location
    Belgium
    MS-Off Ver
    2010
    Posts
    15

    Re: More than 1 TRUE value in and IF formula

    So finally after a lot of testing it worked with this code:
    =IF($E$6="N";IF($B$8=1180;$G$97;$G$83);IF($B$8=1180;IF(IF($B9=$B12;$E11+$E14;$E11)>500;$G$97;IF(IF($B9=$B12;$E11+$E14;$E11)>200;$F$97;$E$97));IF(IF($B9=$B12;$E11+$E14;$E11)>500;$G$83;IF(IF($B9=$B12;$E11+$E14;$E11)>200;$F$83;$E$83))))+IF(MID(B9;1;1)="R";$H$97)+IF(MID(B9;1;1)="Z";$H$83)+IF(MID(B9;3;4)="A00B";$B$75)+IF(MID(B9;8;4)="A00B";$B$75)+IF(MID(B9;3;1)="P";IF(MID(B9;6;1)="E";IF(OR(MID(B9;4;2)={"09";"02";"01"});$B$77;$B$78)))+IF(MID(B9;8;1)="P";IF(MID(B9;11;1)="E";IF(OR(MID(B9;9;2)={"09";"02";"01"});$B$77;$B$78)))+IF(MID(B9;3;1)="P";IF(MID(B9;6;1)="B";IF(OR(MID(B9;4;2)={"09";"02";"01"});0;$B$76)))+IF(MID(B9;8;1)="P";IF(MID(B9;11;1)="B";IF(OR(MID(B9;9;2)={"09";"02";"01"});0;$B$76)))+IF(MID(B9;3;1)="P";IF(MID(B9;6;1)="H";IF(MID(B9;4;2)="02";$B$79;$B$80)))+IF(MID(B9;8;1)="P";IF(MID(B9;11;1)="H";IF(MID(B9;9;2)="02";$B$79;$B$80)))+IF(MID(B9;3;1)="Q";IF(MID(B9;6;1)="B";IF(OR(MID(B9;4;2)={"09";"02"});$B$81)))+IF(MID(B9;8;1)="Q";IF(MID(B9;11;1)="B";IF(OR(MID(B9;9;2)={"09";"02"});$B$81)))+IF(MID(B9;3;1)="Q";IF(MID(B9;6;1)="E";IF(OR(MID(B9;4;2)={"09";"02"});$B$82)))+IF(MID(B9;8;1)="Q";IF(MID(B9;11;1)="B";IF(OR(MID(B9;9;2)={"09";"02"});$B$82)))+IF(MID(B9;3;1)="K";IF(MID(B9;6;1)="B";IF(OR(MID(B9;4;2)={"09";"02"});$B$83)))+IF(MID(B9;8;1)="K";IF(MID(B9;11;1)="B";IF(OR(MID(B9;9;2)={"09";"02"});$B$83)))+IF(MID(B9;3;1)="K";IF(MID(B9;6;1)="H";IF(OR(MID(B9;4;2)={"09";"02"});$B$84)))+IF(MID(B9;8;1)="H";IF(MID(B9;11;1)="B";IF(OR(MID(B9;9;2)={"09";"02"});$B$84)))+IF(MID(B9;3;1)="N";IF(MID(B9;6;1)="B";IF(MID(B9;4;2)="09";$B$85;$B$86)))+IF(MID(B9;8;1)="N";IF(MID(B9;11;1)="B";IF(MID(B9;9;2)="09";$B$85;$B$86)))+IF(MID(B9;3;1)="N";IF(MID(B9;6;1)="E";IF(MID(B9;4;2)="09";$B$87;$B$88)))+IF(MID(B9;8;1)="N";IF(MID(B9;11;1)="E";IF(MID(B9;9;2)="09";$B$87;$B$88)))+IF(MID(B9;3;1)="M";IF(MID(B9;6;1)="E";IF(MID(B9;4;2)="09";$B$89;$B$90)))+IF(MID(B9;8;1)="M";IF(MID(B9;11;1)="E";IF(MID(B9;9;2)="09";$B$89;$B$90)))+IF(MID(B9;3;1)="D";IF(MID(B9;6;1)="E";$B$91))+IF(MID(B9;8;1)="D";IF(MID(B9;11;1)="E";$B$91))+IF(MID(B9;3;1)="4";IF(MID(B9;6;1)="B";IF(MID(B9;4;2)="09";$B$92)))+IF(MID(B9;8;1)="4";IF(MID(B9;11;1)="B";IF(MID(B9;9;2)="09";$B$92)))+IF(MID(B9;3;1)="4";IF(MID(B9;6;1)="E";IF(MID(B9;4;2)="09";$B$93)))+IF(MID(B9;8;1)="4";IF(MID(B9;11;1)="E";IF(MID(B9;9;2)="09";$B$93)))+IF(MID(B9;3;4)="B005";$B$94)+IF(MID(B9;3;4)="B006";$B$95)+IF(MID(B9;3;4)="L005";$B$96)+IF(MID(B9;3;4)="L006";$B$97)+IF(MID(B9;3;4)="I005";$B$98)+IF(MID(B9;3;4)="I006";$B$99)+IF(MID(B9;3;4)="I003";$B$100)+IF(MID(B9;8;4)="B005";$B$94)+IF(MID(B9;8;4)="B006";$B$95)+IF(MID(B9;8;4)="L005";$B$96)+IF(MID(B9;8;4)="L006";$B$97)+IF(MID(B9;8;4)="I005";$B$98)+IF(MID(B9;8;4)="I006";$B$99)+IF(MID(B9;8;4)="I003";$B$100)


    As you can see I've used a lot of your {...} codes which I'm very thankful for!

    Thanks or helping me out!

+ 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. Help popup window if condition is TRUE in change event if conditon is true
    By fanku in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-09-2014, 12:46 PM
  2. Formula to pull text from multiple cells if formula = true
    By bommar2 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-13-2013, 12:16 PM
  3. Formula question - cell value to make a formula true?
    By jabadeer in forum Excel General
    Replies: 3
    Last Post: 07-19-2011, 12:07 PM
  4. Function to return True/False if all are validated as True by ISNU
    By Tetsuya Oguma in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2006, 06:30 AM
  5. [SOLVED] Formula is true if proportion of range is true
    By nussbaum in forum Excel General
    Replies: 3
    Last Post: 01-23-2005, 10:07 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