Updated Formula Help - Let(a,CHOOSE

zone709

Well-known Member
Joined
Mar 1, 2016
Messages
2,125
Office Version
  1. 365
Platform
  1. Windows
=LET(a,CHOOSE({1,2},H3:H2800,I3:I2800),b,UNIQUE(a),c,INDEX(b,0,1),d,INDEX(b,0,2),CHOOSE({1,2,3},c,d,SUMIFS(J3:J2800,H3:H2800,c,I3:I2800,d)))

Hi need to update formula below. The first sheet is how the formula works now. Returns for me in Column L M & N. As it looks through H i & J then sums total sum.

The second sheet Below is what i need to be updated. I need to also look into Column B and if job is different also with Column i class code. Then return total sum in column O with the adding the job in Column M as you can see Column M as an example.

Sheet 1

Book1
ABCDEFGHIJKLMN
1project_codecontract_idwork_orderweek_end_datecheck_numssnemployee_IDclass_code gross_employee_pay all_projects
2don't put values in this columnOld Formula in here
3154 2nd35Super5000.005000.0035Super$ 5,000.00
4625 5th35Concrete5000.005000.0035Concrete$ 5,000.00
5625 5th10Operator5562.505562.5010Operator$ 5,562.50
6625 5th10Super6500.006500.0010Super$ 6,500.00
71253 3rd Street20Carpentry5000.005000.0020Carpentry$ 5,000.00
84506 75th Street20Concrete1000.001000.0020Concrete$ 1,000.00
9625 5th15Super4750.004750.0015Super$ 4,750.00
101253 65th Street15Carpentry2437.502437.5015Carpentry$ 3,437.50
114506 75th Street15Carpentry1000.001000.0000.00$ -
Sheet1


Sheet 2

Book2
ABCDEFGHIJKLMNO
1`project_codecontract_idwork_orderweek_end_datecheck_numssnemployee_IDclass_code gross_employee_pay all_projects
2don't put values in this columnFormulaNeed to add this now
3154 2nd35Super5000.005000.0035154 2ndSuper$ 5,000.00
4625 5th35Concrete5000.005000.0035625 5thConcrete$ 5,000.00
5625 5th10Operator5562.505562.5010625 5thOperator$12,062.50
6625 5th10Operator6500.006500.00201253 3rd StreetCarpentry$ 5,000.00
71253 3rd Street20Carpentry5000.005000.00204506 75th StreetConcrete$ 1,000.00
84506 75th Street20Concrete1000.001000.0015625 5thSuper$ 4,750.00
9625 5th15Super4750.004750.00151253 65th StreetCarpentry$ 2,437.50
101253 65th Street15Carpentry2437.502437.50154506 75th StreetCarpentry$ 1,000.00
114506 75th Street15Carpentry1000.001000.00
Sheet1
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
try

Excel Formula:
=LET(data,IFERROR(HSTACK(H3:H100,B3:B100,I3:I100,J3:J1100),0),a,UNIQUE(TAKE(data,,3)),HSTACK(UNIQUE(TAKE(a,,3)),SUMIFS(J3:J100,H3:H100,INDEX(a,,1),B3:B100,INDEX(a,,2),I3:I100,INDEX(a,,3))))
 
Upvote 0
Solution
try

Excel Formula:
=LET(data,IFERROR(HSTACK(H3:H100,B3:B100,I3:I100,J3:J1100),0),a,UNIQUE(TAKE(data,,3)),HSTACK(UNIQUE(TAKE(a,,3)),SUMIFS(J3:J100,H3:H100,INDEX(a,,1),B3:B100,INDEX(a,,2),I3:I100,INDEX(a,,3))))
HI thank for the reply. So i entered this formula into Column L but it only gives results in Col L for ID's. I need it to return the results for Column M if different jobs like COlumn N different class code with the SUMIf total in Column O.

The original works like that but was giving me back the ID# and total Sumifs for the ID # with different class codes totals. Now trying to add the Job also in column B as its different alot.


2.xlsx
ABCDEFGHIJKLMNO
2don't put values in this columnNew FormulaExample ResultsExample ResultsExample Results
3154 2nd35Super5000.005000.0035154 2ndSuper$ 5,000.00
4625 5th35Concrete5000.005000.0035625 5thConcrete$ 5,000.00
5625 5th10Operator5562.505562.5010625 5thOperator$ 12,062.50
61253 3rd Street10Carpentry6500.006500.00101253 3rd StreetCarpentry$ 5,000.00
71253 3rd Street20Carpentry5000.005000.00201253 3rd StreetCarpentry$ 1,000.00
8625 5th20Concrete1000.001000.0020625 5thConcrete$ 4,750.00
9625 5th15Super4750.004750.0015625 5thCarpentry$ 2,437.50
104506 75th Street15Carpentry2437.502437.50154506 75th StreetCarpentry$ 1,000.00
1115Carpentry1000.001000.0015
Formula
 
Last edited:
Upvote 0
The formula I gave is an array, not copied down one by one, see this picture

1722003266063.png
 
Upvote 0
OK i put formula in L3. when i press enter it gives me #SPILL

I alson press ctlr shift and enter but when doing so. It just gives me one ID number in L3

i put formula in L3 and all it returns is 35.

2.xlsx
ABCDEFGHIJKLM
1`project_codecontract_idwork_orderweek_end_datecheck_numssnemployee_IDclass_code gross_employee_pay all_projects
2don't put values in this columnFormulaNeed to add this now
3154 2nd35Super5000.005000.0035
4625 5th35Concrete5000.005000.00
5625 5th10Operator5562.505562.50
6625 5th10Operator6500.006500.00
71253 3rd Street20Carpentry5000.005000.00
84506 75th Street20Concrete1000.001000.00
9625 5th15Super4750.004750.00
101253 65th Street15Carpentry2437.502437.50
114506 75th Street15Carpentry1000.001000.00
12
Sheet1
 
Last edited:
Upvote 0
OK i put formula in L3. when i press enter it gives me #SPILL
clear cell L4 down and columns M, N, O without any formulas or text,

So that's why the formula produces an Array, the #Spill error means that the Array's range is blocked by several cells that contain values
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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