CHOOSE function with Boolean expressions vs. Too many nested IF functions

Reynola5

New Member
Joined
May 7, 2017
Messages
2
Hi, my first time posting. Would really appreciate any help :).

I have a file showing products in one column and the volume of each product in another.

I am trying to create a list of products groupings (CONCATENATE) based on the cumulative volume of the products. Within my source data each product is shown in Column B has a volume in Column E.

The list I wish to create begins in row 385 and I have numbered each item in column C. So the first item in the list is labelled no. “1” in cell C385.
The result I am looking for is that, once the cumulative amount in my data column B exceeds the list number in my results, I can CONCATENATE the names of a set of these products from Column B of my source data.

For example if the cumulative value of my list at cell E286 is 4, the first 4 lines of my results list should populate.
I have a working formula to achieve this as follows:

=(IF(ROUND(SUM($E$283),0)>=C385,(CONCATENATE($B$281,$B$282,$B$283)),” “)&(IF(ROUND(SUM($E$283:$E$284),0)>=C385,(CONCATENATE($B$281,$B$282,$B$284)),” “)&IF(ROUND(SUM($E$283:$E$285),0)>=C385,(CONCATENATE($B$281,$B$282,$B$285)),” “)&IF(ROUND(SUM($E$283:$E$286),0)>=C385,(CONCATENATE($B$281,$B$282,$B$286)),” “)))))

However as the lists are quite long this would require too many nested IF functions. I have heard about using CHOOSE functions with Boolean expressions to achieve such results. I have tried converting my formula to this option below, however I am afraid that I don’t fully understand this formula, particularly the “Error” component. Might someone be able to point out where I am going wrong with the below, or even better suggest an alternative solution to achieve my goal? Any help would really be appreciate

=CHOOSE(1+(ROUND(SUM($E$283),0)>=C385*1+(ROUND(SUM($E$283:$E$284),0)>=C385*2+(ROUND(SUM($E$283:$E$285),0)>=C385*3+(ROUND(SUM($E$283:$E$286),0)>=C385*4,”Error”,(CONCATENATE($B$281,$B$282,$B$283)),(CONCATENATE($B$281,$B$282,$B$284)),(CONCATENATE($B$281,$B$282,$B$285)),(CONCATENATE($B$281,$B$282,$B$286)))

Thanks
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
For example if the cumulative value of my list at cell E286 is 4, the first 4 lines of my results list should populate.
I have a working formula to achieve this as follows:

=(IF(ROUND(SUM($E$283),0)>=C385,(CONCATENATE($B$281,$B$282,$B$283)),” “)&(IF(ROUND(SUM($E$283:$E$284),0)>=C385,(CONCATENATE($B$281,$B$282,$B$284)),” “)&IF(ROUND(SUM($E$283:$E$285),0)>=C385,(CONCATENATE($B$281,$B$282,$B$285)),” “)&IF(ROUND(SUM($E$283:$E$286),0)>=C385,(CONCATENATE($B$281,$B$282,$B$286)),” “)))))

However as the lists are quite long this would require too many nested IF functions.

They are NOT NESTED IFs, so you wouldn't have any limit!

I have heard about using CHOOSE functions with Boolean expressions to achieve such results. I have tried converting my formula to this option below, however I am afraid that I don’t fully understand this formula, particularly the “Error” component. Might someone be able to point out where I am going wrong with the below, or even better suggest an alternative solution to achieve my goal? Any help would really be appreciate

=CHOOSE(1+(ROUND(SUM($E$283),0)>=C385*1+(ROUND(SUM($E$283:$E$284),0)>=C385*2+(ROUND(SUM($E$283:$E$285),0)>=C385*3+(ROUND(SUM($E$283:$E$286),0)>=C385*4,”Error”,(CONCATENATE($B$281,$B$282,$B$283)),(CONCATENATE($B$281,$B$282,$B$284)),(CONCATENATE($B$281,$B$282,$B$285)),(CONCATENATE($B$281,$B$282,$B$286)))

In CHOOSE you have a value of a cell or an expression which relates to the position in a list, Normally this is a serial value incremented from 1.

We will await your screenshot before suggesting how this problem can be solved.
 
Upvote 0
Thank you for the response. This is already quite helpful. I have included a screenshot below with sample data and the result using the IF function. As noted the issue is that I will have numerous Groups and seasons so the formula becomes quite long using IF.

DATA:
Number of Product groupings10
Combinations:
Group 1ProportionsWeightingProducts included in grouping
Summer 60%
Bargain12%7%1
Saver20%12%1
Standard30%18%2
Premium 18%11%1
Luxury20%12%1
Winter40% 0
Bargain12%5%0
Saver20%8%1
Standard30%12%1
Premium 18%7%1
Luxury20%8%1
RESULTS:
# Product
1Group 1Summer Bargain
2Group 1Summer Saver
3Group 1Summer Standard
4Group 1Summer Standard
5Group 1Summer Premium
6Group 1Summer Luxury
7Group 1WinterSaver
8Group 1WinterStandard
9Group 1WinterPremium
10 Group 1WinterLuxury
Formula for Product #1
=IF(ROUND(SUM($E$5),0)>=C18,(CONCATENATE($B$3,$B$4,$B$5)),IF(ROUND(SUM($E$5:$E$6),0)>=C18,(CONCATENATE($B$3,$B$4,$B$6)),IF(ROUND(SUM($E$5:$E$7),0)>=C18,(CONCATENATE($B$3,$B$4,$B$7)),IF(ROUND(SUM($E$5:$E$8),0)>=C18,(CONCATENATE($B$3,$B$4,$B$8)),IF(ROUND(SUM($E$5:$E$9),0)>=C18,(CONCATENATE($B$3,$B$4,$B$9)),IF(ROUND(SUM($E$5:$E$11),0)>=C18,(CONCATENATE($B$3,$B$10,$B$11)),IF(ROUND(SUM($E$5:$E$12),0)>=C18,(CONCATENATE($B$3,$B$10,$B$12)),IF(ROUND(SUM($E$5:$E$13),0)>=C18,(CONCATENATE($B$3,$B$10,$B$13)),IF(ROUND(SUM($E$5:$E$14),0)>=C18,(CONCATENATE($B$3,$B$10,$B$14)),IF(ROUND(SUM($E$5:$E$15),0)>=C18,(CONCATENATE($B$3,$B$10,$B$15))))))))))))

<tbody>
</tbody><colgroup><col><col><col span="2"><col><col span="2"></colgroup>
 
Upvote 0
The problem becomes much easier if you add a couple of helper columns:


Book1
ABCDEFGHI
1DATA:RESULTS:
2Number of Product groupings10Product
3Combinations:1Group 1 Summer Bargain
4Group 1ProportionsWeightingProducts included in groupingCumulative countProduct2Group 1 Summer Saver
5Summer60%3Group 1 Summer Standard
6Bargain12%7%11Group 1 Summer Bargain4Group 1 Summer Standard
7Saver20%12%12Group 1 Summer Saver5Group 1 Summer Premium
8Standard30%18%24Group 1 Summer Standard6Group 1 Summer Luxury
9Premium18%11%15Group 1 Summer Premium7Group 1 Winter Saver
10Luxury20%12%16Group 1 Summer Luxury8Group 1 Winter Standard
11Winter40%69Group 1 Winter Premium
12Bargain12%5%06Group 1 Winter Bargain10Group 1 Winter Luxury
13Saver20%8%17Group 1 Winter Saver
14Standard30%12%18Group 1 Winter Standard
15Premium18%7%19Group 1 Winter Premium
16Luxury20%8%110Group 1 Winter Luxury
Sheet1
Cell Formulas
RangeFormula
C6=$B6*$B$5
C12=$B12*$B$11
E6=SUM($D$5:$D6)
F6=$A$4&" "&$A$5&" "&$A6
F12=$A$4&" "&$A$11&" "&$A12
I3=INDEX($F$6:$F$16,IFERROR(MATCH($H3-1,$E$6:$E$16,1)+1,1))


You can always hide them from view ...

WBD
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

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