The calculation in Excel works, but only in a single row

pyclen

Board Regular
Joined
Jan 17, 2022
Messages
85
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi All,

I apologize as this may be a trivial solution however I am stuck with the current solution provided by one of the members of this forum (Thank you again, bebo021999)

The previous thread is here: getting excel to calculate correctly

my problem is that the solution presented only works for a single row (I thought I could adopt to multiple rows, duh)

The formula is N4 works for this particular cell or better the first row (test 1, N4:V4) however it does not work in N5 and below as well as O5 and on.
What needs to happen is that somehow an index/match or lookup needs to be added to the formula in N4 to make it look up what test it is and how many samples there are to make it work

Again, very appreciative of this forum and any/every help received


Example.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAK
2setup hoursreplicate hours
3TestDifficultyGroupSurchargehourly ratesetup hoursreplicate hours#of setupsReplicates# of lots/strengthsOrientationsPackaging ConfigurationsT0T1t2T3T4T5t6t7t8surchargeGrouphr rateTestavghiavghi
4test 1avggrp10%1001111111$200$300$400$500$600$700$800$900$1,0000grp1100test 11111
5test 2avggrp10%1002211111$400$600$800$1,000$1,200$1,400$1,600$1,800$2,0000.1grp2150test 22222
6test 3avggrp10%1003311111$600$900$1,200$1,500$1,800$2,100$2,400$2,700$3,0000.2grp3175test 33333
7test 4avggrp10%1004411111$800$1,200$1,600$2,000$2,400$2,800$3,200$3,600$4,0000.3test 44444
8test 5avggrp10%1005511111$1,000$1,500$2,000$2,500$3,000$3,500$4,000$4,500$5,0000.4test 55555
9
10
11stability timepointsT0T1t2T3T4T5t6t7t8
12test 1123456789
13test 2123456789
14test 3123456789
15test 4123456789
16test 5123456789
Sheet1
Cell Formulas
RangeFormula
F4:F8F4=ROUND(IF(COUNTA($D4:$E4)<2,"",VLOOKUP($D4,$AB$4:$AC$6,2,0)*(1+$E4)),0)
G4:G8G4=IF($B4="","",INDEX(setup,MATCH($B4,test,0),MATCH($C4,Difficulty,0)))
H4:H8H4=IF($B4="","",INDEX(replicate,MATCH($B4,test,0),MATCH($C4,Difficulty,0)))
I4:I8I4=ROUNDUP(PRODUCT($J4:$M4)/10,0)
N4:V8N4=$F4*($G4*ROUNDUP(HLOOKUP(N$3,$C$11:$K$16,2,0)*$J4*$K4*$L4*$M4/10,0)+$H4*HLOOKUP(N$3,$C$11:$K$16,2,0)*$J4*$K4*$L4*$M4)
B12:B16B12=B4
Named Ranges
NameRefers ToCells
Difficulty=Sheet1!$AG$3:$AH$3G4:H8
group=Sheet1!$AB$4:$AB$6F4:F8
rate=Sheet1!$AC$4:$AC$6F4:F8
replicate=Sheet1!$AI$4:$AJ$8H4:H8
setup=Sheet1!$AG$4:$AH$8G4:G8
test=Sheet1!$AF$4:$AF$8G4:H8
Cells with Data Validation
CellAllowCriteria
B4:B8List=test
C4:C8List=Difficulty
D4:D8List=group
E4:E8List=surcharge
 
The tests are arranged like shown in the table and each line is only 'be responsible' for that particular test, it would need a match/lookup of that particular test field (B12:B16) to calculate the correct cost
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Maybe
Excel Formula:
=LET(p,INDEX(FILTER(FILTER($C$12:$K$90,$B$12:$B$90=$B4),$C$11:$K$11=N$3),COUNTIFS($B$4:$B4,$B4))*$J4*$K4*$L4*$M4,$F4*($G4*ROUNDUP(p/10,0)+$H4*p))
 
Upvote 0
THank you again for your help, I will trial this and hope this works
 
Upvote 0
Thank you again for your help, I have it working for my whole table, I verified the whole calculation using 'hand math' (i.e., calculating it out by hand) as well as using the current calculating tool which has a lot of legacy, is more clumsy, and especially for Newbies and people that are unfamiliar with the workings, difficult to understand.

Excellent stuff
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,255
Members
449,075
Latest member
staticfluids

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