+ Reply to Thread
Results 1 to 14 of 14

If a,b,c,d =2,3,4,5 in any order then e = 50

  1. #1
    Registered User
    Join Date
    08-01-2014
    Location
    Arizona
    MS-Off Ver
    2010
    Posts
    6

    If a,b,c,d =2,3,4,5 in any order then e = 50

    If it was a simple as my title "If a,b,c,d =2,3,4,5 in any order then e = 50" I could use. IF(and(or(A=2,A=3,A=4,A=5),"50",OR(B=2,B=3,B=4,B=5),"50",OR(C=2,C=3,C=4,C=5),"50",OR(D=2,D=3,D=4,D=5),"50","No").

    But I have several rows of like data and I will quickly run into error "the specified formula cannot be entered because it contains more values, references and/or names than are allowed in the current file format."

    if 2,3,4,5 =50
    if 1,2,3,4 = 75

    A B C D
    2 3 4 5
    4 5 3 2
    1 2 3 4
    3 4 1 2
    3 4 5 6

    E would = 250

    I hope that makes since...

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,854

    Re: If a,b,c,d =2,3,4,5 in any order then e = 50

    Does it all have to occur in a single cell? Here's how I did it:

    1) In F1, G1, H1, I1, enter the values to look for (2,3,4,5)
    2) In F2, enter =sign(match(F$2,$A2:$D2,0)) and copy down and across. Note the use of relative and absolute references. This will return 1 for where the value is found, or an #N/A error where not found.
    3) In E2, enter =IF(ISERROR(SUM(F2:I2)),0,50). If there are any errors in the sum range, then the iserror() function will catch that and tell us that one of the values was not found. if there are no errors, then we can return the value of 50 that you requested (note that I did not include the 50 in quotes so that it is the actual number 50. If you need this to be the "number stored as text" "50" text string, include the quotes). I'm sure someone who is more skilled at combining multiple single formulas into more complex single cell megaformulas can combine that into a single cell, but I tend to avoid that.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Valued Forum Contributor
    Join Date
    11-02-2016
    Location
    NY
    MS-Off Ver
    2010
    Posts
    459

    Re: If a,b,c,d =2,3,4,5 in any order then e = 50

    I'm not following. I understand if it contains 2-5 it's result is 50, but why is 1-4 75? Also, where you have 'E would = 250' what does that refer to? And why is it 250.
    Please take a moment to prepare the file with examples, so logic can be better understood. ( I suppose a formula could be written if any column contains 2 - 5 the result would be 50 and you could filter all the non50 amounts. Still lost on the calculation.

    I hope this makes CENTS too (should be sense!)

  4. #4
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: If a,b,c,d =2,3,4,5 in any order then e = 50

    Hi All,

    first serie in A1:D1

    In E1 to be copied down

    =(COUNT(MATCH(NUM(IF(1,INDEX(ROW($2:$5),))),A1:D1,0))=4)*50+(COUNT(MATCH(NUM(IF(1,INDEX(ROW($1:$4),))),A1:D1,0))=4)*75

    Regards
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  5. #5
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: If a,b,c,d =2,3,4,5 in any order then e = 50

    Hi again

    if I have understood, a different approach and same numbers from

    =(FREQUENCY(A1:D1,ROW($2:$5))=1)*50+(FREQUENCY(A1:D1,ROW($1:$4))=1)*75

    Hope it helps
    Attached Files Attached Files
    Last edited by canapone; 11-22-2016 at 03:14 PM.

  6. #6
    Valued Forum Contributor
    Join Date
    11-02-2016
    Location
    NY
    MS-Off Ver
    2010
    Posts
    459

    Re: If a,b,c,d =2,3,4,5 in any order then e = 50

    Still not clear on what the formula/ relationship is if it is NOT the normal set of 2,3,4,5 BUT here's another attempt.
    So I put in "look here" if it is NOT the normal set. You can add whatever formula is supposed to be used in place of "look here".
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-01-2014
    Location
    Arizona
    MS-Off Ver
    2010
    Posts
    6

    Re: If a,b,c,d =2,3,4,5 in any order then e = 50

    I've added a file. Hope it helps.
    Attached Files Attached Files

  8. #8
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,502

    Re: If a,b,c,d =2,3,4,5 in any order then e = 50

    This looks like it would work if I understand your needs correctly... in cell E1=IF(SUM(A1:D1)=14,50,IF(SUM(A1:D1)=10,75,0))
    and in cell F1=IF(SUM(A1:D1)=14,20,IF(SUM(A1:D1)=10,15,0))
    drag both downward.
    Last edited by Sam Capricci; 11-22-2016 at 09:22 PM.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  9. #9
    Registered User
    Join Date
    08-01-2014
    Location
    Arizona
    MS-Off Ver
    2010
    Posts
    6

    Re: If a,b,c,d =2,3,4,5 in any order then e = 50

    I'm not looking for if the sum of the cells = 14 then it should equal 50. Maybe using numbers was not a good representation. I change the labeling a bit maybe that will help
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: If a,b,c,d =2,3,4,5 in any order then e = 50

    Hi in E1

    Please Login or Register  to view this content.
    in F1

    Please Login or Register  to view this content.
    ----------------------------------------------

    Another possible solutions

    in E1

    Please Login or Register  to view this content.
    in F1

    Please Login or Register  to view this content.

    Hope it helps
    Attached Files Attached Files

  11. #11
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,854

    Re: If a,b,c,d =2,3,4,5 in any order then e = 50

    How much did you dislike all the helper cells I proposed? I would probably build a "truth table" in a helper table like I show above. Then analyze that truth table. Perhaps some binary arithmetic or boolean algebra from there. Perhaps Follow that up with a lookup table to return the value you want for each truth table combination.

  12. #12
    Registered User
    Join Date
    08-01-2014
    Location
    Arizona
    MS-Off Ver
    2010
    Posts
    6

    Re: If a,b,c,d =2,3,4,5 in any order then e = 50

    MrShorty, I could not figure yours out so I do not know if it would of worked.

  13. #13
    Registered User
    Join Date
    08-01-2014
    Location
    Arizona
    MS-Off Ver
    2010
    Posts
    6

    Re: If a,b,c,d =2,3,4,5 in any order then e = 50

    Canapone, your countif worked.

  14. #14
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: If a,b,c,d =2,3,4,5 in any order then e = 50

    Ciao,

    thanks for sharing feedback.

+ 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. Replies: 7
    Last Post: 03-20-2016, 12:06 PM
  2. rolling order forecast - order planning excel combination of formulas
    By confused44 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-17-2015, 02:01 AM
  3. Replies: 4
    Last Post: 12-02-2014, 03:46 AM
  4. Replies: 1
    Last Post: 12-01-2014, 03:01 PM
  5. [SOLVED] Order Form to Summarise Order on another sheet with a Submit Order Button
    By KazzICC in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-01-2014, 03:25 AM
  6. How to connect purchase order and sell order with party ledger and daily day book
    By harisjawed86 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-26-2014, 11:36 AM

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