Help Needed to Simplify Formula with Multiple Cominations with Multiple Variables

xtreme07

Board Regular
Joined
Sep 21, 2010
Messages
71
Hi,

i have a formula that needs to be simplified in excel as there's many variables and i would end up spending a lot of time on it.

this is the formula
=
IF(AND(A1<=10,B1<=10,C1<=10,D1<=10),"1.1.1.1"
IF(AND(A1>=20,B1<=10,C2<=10,D1<=10),"2.1.1.1",
,"FALSE")

the same formula has more lines, in which A1 needs to meet some more numbers criteria. i've just decided to have it short to outline the basics of it.

as you might have noticed, there's 3 PRINT modes:
PRINT1 = 1.1.1.1
PRINT2 = 2.1.1.1
PRINT3 = FALSE

in PRINT2, the A1 criteria has changed, which is why i asked that it will PRINT 2.1.1.1 if the criteria is true
else, if the criteria is not true, it will PRINT false (PRINT3)

THE ISSUE that i have is that this formula that i'm using will have many combinations .. about 15 combinations if not more.
WONDERING if there's a way i can ease my pain in excel.


excel likeA
B
C
D
E
1
161112
2
10192840
3
4581718
4
22422532
5
32334773
6
4593691

<tbody>
</tbody>
 
Last edited:
another simplified version would be to think of a matrice

a b
c d

equivalent to

1 2
3 4

where a,b,cd represent the conditions
and number 1,2,3,4 represent the output, based on whether the conditions are met or not
also, the output having values of 1-4 for ach letter

for example A can have the output 1, or 2, or 3, or 4
and the same for the B, C, D

that's because A condition ca be varied as A1, A2, A3, A4
B condition having 4 variables as well, B1, B2, B3, B4
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
I'm afraid what you've written is incomprehensible to me. Can't you post some real-life examples of your data together with the desired result?
 
Upvote 0
download file link is external - on mediafire.com
click this to download

i'm using external link cause i can't see any atachement option ...
this is the same file i've provided yesterday.

to download, go to the external link and click download button from the top of the page
to open the file excel 2007 or later is needed. i tried to save it as 2003 version but there's compatibility issues.

let me know if it works for you

here's the formula used in the file
Code:
=
IF(AND(B2<=60,C2<=40,[U](D2+E2)<=   10[/U]),"1.1.[U]1[/U]",
IF(AND(B2<=60,C2<=40,[U](D2+E2)<=   20)[/U],"1.1.[U]2[/U]",
IF(AND(B2<=60,C2<=40,[U](D2+E2)<= 1000)[/U],"1.1.[U]3[/U]",

IF(AND([U]B2> 60[/U],C2<=40,(D2+E2)<=   10),"[U]2[/U].1.1",
IF(AND([U]B2> 60[/U],C2<=40,(D2+E2)<=   20),"[U]2[/U].1.2",
IF(AND([U]B2> 60[/U],C2<=40,(D2+E2)<= 1000),"[U]2[/U].1.3",

IF(AND(B2> 60,[U]C2> 40[/U],(D2+E2)<=   10),"2.[U]2[/U].1",
IF(AND(B2> 60,[U]C2> 40[/U],(D2+E2)<=   20),"2.[U]2[/U].2",
IF(AND(B2> 60,[U]C2> 40[/U],(D2+E2)<=  100),"2.[U]2[/U].3",
"FALSE")))))))))

UNDERLINED is where the formula has changed compared to the previous rows
 
Last edited:
Upvote 0
if you feel like you'r spending to much time on it, it's ok to quit this one.
i don't mind ... not saying i wouldn't like to have this solved ...but i don't what you to be spending to much time on something that's to hard to understand.
 
Upvote 0
below you can see live example


Excel 2007
ABCDEF
1
keywords
da
paifleflforumla for b, c, d, e
2occupational safety and health administration111.1.1
3rapid rewards enrollment promotion code111.1.1
4dating site in usa19335151.1.2
5 bali cashews11231411.1.2
6love and basketball full movie22161301.1.2
7free royalty free images60341201.1.2
8what is a life coach343919391.1.3
9sunday dinner ideas472835921.1.3
10aliments riches en vitamine d45198501.1.3
11short term effects of smoking8635032.1.1
12home remedies for glowing skin9029202.1.1
13how to reduce hair fall9412.1.1
14how to stop hair fall9412.1.1
15home remedies for hair fall8212.1.1
16weight loss workouts7750162.1.2
17gifts for husband77401152.1.2
18blood clot in leg symptoms92321312.1.2
19bondara voucher code63251302.1.2
20black and decker parts74321202.1.2
21cheap halloween costumes64271102.1.2
22pre diabetes diet619644112.1.3
23ice cream games for girls653116102.1.3
24ice cream games65116102.1.3
25gluten free cornbread7013002.1.3
26wiggle discount code63292902.1.3
27angie s list promo code8546082.2.1
28almond butter vs peanut butter7943052.2.1
29how to make a candle9247442.2.1
30how does solar power work9546002.2.1
31how does solar energy work9546002.2.1
32what is a balanced diet93582182.2.2
33how to check blood pressure96564162.2.2
34symptoms of low blood sugar96471212.2.2
35how to make curry92461902.2.2
36creatine side effects90637892.2.3
37brussel sprouts nutrition88638822.2.3
38home remedies for yeast infection926312772.2.3
39victoria sponge cake805734642.2.3
40sweet potato soup93625612.2.3
41healthy blueberry muffins814612372.2.3
42ice cream factory45536381FALSE
43green star juicer39484380FALSE
44frozen yogurt machine4951196173FALSE
45oatmeal cookies -raisins3242250FALSE

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
F2=IF(AND(B2<=60,C2<=40,(D2+E2)<=10),"1.1.1",
IF(AND(B2<=60,C2<=40,(D2+E2)<=20),"1.1.2",
IF(AND(B2<=60,C2<=40,(D2+E2)<=1000),"1.1.3",
IF(AND(B2>60,C2<=40,(D2+E2)<=10),"2.1.1",
IF(AND(B2>60,C2<=40,(D2+E2)<=20),"2.1.2",
IF(AND(B2>60,C2<=40,(D2+E2)<=1000),"2.1.3",
IF(AND(B2>60,C2>40,(D2+E2)<=10),"2.2.1",
IF(AND(B2>60,C2>40,(D2+E2)<=20),"2.2.2",
IF(AND(B2>60,C2>40,(D2+E2)<=1000),"2.2.3",
"FALSE"
)
)
)
)
)
)
)
)
)

<tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Now we're getting somewhere!!

Based on your sample of data, the below formula returns the correct result for all rows apart from the last 4. It's much shorter and simpler than the nested IF's and AND's you've been using. I'll post back when I have a fully working version.

=IF(B2<=60,1,2)&"."&IF(C2<=40,1,2)&"."&LOOKUP(D2+E2,{0,11,21},{1,2,3})

One question - does the formula actually have to contain a decimal point between each digit, or could we simply return a string of numbers which are formatted so that they appear to be separated by a decimal point?
 
Upvote 0
And here's the fully working formula. First version includes decimal points between each digit, the 2nd doesn't, but can appear the same if you use custom formatting...
=IF(OR(D2+E2>1000,AND(B2<=60,C2>40)),"FALSE",IF(B2<=60,1,2)&"."&IF(C2<=40,1,2)&"."&LOOKUP(D2+E2,{0,11,21},{1,2,3}))
=IF(OR(D2+E2>1000,AND(B2<=60,C2>40)),"FALSE",(IF(B2<=60,1,2)&IF(C2<=40,1,2)&LOOKUP(D2+E2,{0,11,21},{1,2,3}))+0)
(formatted as 0"."0"."0)
 
Upvote 0
cool .. it works ... so, THANK YOU Very Much ...i would probably kiss you if you were next to me :)) (i'll pretend to be a woman in case you'r picturing me kissing you)

it must have been a grueling thread :) it was for me for sure ...
everything feels so good now ...

next thing on my to do list is to understand it.
can you tell me what to study to understand the theory behind this ?

to answer your question on the decimal point ...the result needs a decimal point 'cause (from what i remember) it helps with sorting largest to smallest (and vice versa).
 
Upvote 0
Glad we got there in the end, but I'll pass on the kiss if you don't mind!

The final function isn't particularly complicated. The key was to break down the end result into 3 separate digits, which allowed me to condense the duplicated parts of your formula. For example, your first 3 IF statements all tested B2 <=60, and they all resulted in a string of digits where the first character is 1. Therefore, I converted this into IF(B2<=60,1,2). I did exactly the same with IF(C2<=40,1,2).
 
Upvote 0
one last question ... now that the forumla is completed i, need one more adjustment.

how do we add another factor (another column with numbers to analize, and print a value based on it) ?
 
Upvote 0

Forum statistics

Threads
1,215,482
Messages
6,125,061
Members
449,206
Latest member
Healthydogs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top