Anyone can optimize these lookup / sumifs ?

JumboCactuar

Well-known Member
Joined
Nov 16, 2016
Messages
788
Office Version
  1. 365
Platform
  1. Windows
Hi,

i have the following:

[TABLE="width: 697"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Pass Rate[/TD]
[TD]Previous Score[/TD]
[TD]Accumulative Points[/TD]
[TD]Accumulative minus Reduction[/TD]
[TD]Result[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD]100.00%[/TD]
[TD]#DIV/0![/TD]
[TD]89[/TD]
[TD]89[/TD]
[TD]PASSED[/TD]
[TD]89[/TD]
[/TR]
[TR]
[TD]Luke[/TD]
[TD]0.00%[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]FAILED[/TD]
[TD]44[/TD]
[/TR]
[TR]
[TD]George[/TD]
[TD]100.00%[/TD]
[TD]0[/TD]
[TD]82[/TD]
[TD]82[/TD]
[TD]PASSED[/TD]
[TD]82[/TD]
[/TR]
[TR]
[TD]Tim[/TD]
[TD]100.00%[/TD]
[TD]0[/TD]
[TD]95[/TD]
[TD]95[/TD]
[TD]PASSED[/TD]
[TD]95[/TD]
[/TR]
[TR]
[TD]Luke[/TD]
[TD]0.00%[/TD]
[TD]44[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]FAILED[/TD]
[TD]63[/TD]
[/TR]
[TR]
[TD]Fred[/TD]
[TD]100.00%[/TD]
[TD]0[/TD]
[TD]91[/TD]
[TD]91[/TD]
[TD]PASSED[/TD]
[TD]91[/TD]
[/TR]
[TR]
[TD]Lisa[/TD]
[TD]100.00%[/TD]
[TD]0[/TD]
[TD]88[/TD]
[TD]88[/TD]
[TD]PASSED[/TD]
[TD]88[/TD]
[/TR]
[TR]
[TD]Harry[/TD]
[TD]100.00%[/TD]
[TD]0[/TD]
[TD]81[/TD]
[TD]81[/TD]
[TD]PASSED[/TD]
[TD]81[/TD]
[/TR]
[TR]
[TD]Paul[/TD]
[TD]100.00%[/TD]
[TD]0[/TD]
[TD]89[/TD]
[TD]89[/TD]
[TD]PASSED[/TD]
[TD]89[/TD]
[/TR]
[TR]
[TD]George[/TD]
[TD]100.00%[/TD]
[TD]82[/TD]
[TD]177[/TD]
[TD]167[/TD]
[TD]PASSED[/TD]
[TD]95[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD]50.00%[/TD]
[TD]89[/TD]
[TD]89[/TD]
[TD]146[/TD]
[TD]FAILED[/TD]
[TD]67[/TD]
[/TR]
[TR]
[TD]Fred[/TD]
[TD]50.00%[/TD]
[TD]91[/TD]
[TD]91[/TD]
[TD]156[/TD]
[TD]FAILED[/TD]
[TD]75[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD]100.00%[/TD]
[TD]0[/TD]
[TD]82[/TD]
[TD]82[/TD]
[TD]PASSED[/TD]
[TD]82[/TD]
[/TR]
[TR]
[TD]Paul[/TD]
[TD]100.00%[/TD]
[TD]89[/TD]
[TD]182[/TD]
[TD]172[/TD]
[TD]PASSED[/TD]
[TD]93[/TD]
[/TR]
[TR]
[TD]Tim[/TD]
[TD]100.00%[/TD]
[TD]95[/TD]
[TD]185[/TD]
[TD]175[/TD]
[TD]PASSED[/TD]
[TD]90[/TD]
[/TR]
[TR]
[TD]George[/TD]
[TD]66.67%[/TD]
[TD]95[/TD]
[TD]177[/TD]
[TD]244[/TD]
[TD]FAILED[/TD]
[TD]77[/TD]
[/TR]
[TR]
[TD]Paul[/TD]
[TD]100.00%[/TD]
[TD]93[/TD]
[TD]268[/TD]
[TD]258[/TD]
[TD]PASSED[/TD]
[TD]86[/TD]
[/TR]
[TR]
[TD]Fred[/TD]
[TD]66.67%[/TD]
[TD]75[/TD]
[TD]180[/TD]
[TD]245[/TD]
[TD]PASSED[/TD]
[TD]89[/TD]
[/TR]
[TR]
[TD]Luke[/TD]
[TD]0.00%[/TD]
[TD]63[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]FAILED[/TD]
[TD]44[/TD]
[/TR]
</tbody>[/TABLE]


Columns B,C,D and E are all "running values"
Problem i have is when im working with a lot of data (5k rows+), when i input a new value in column A - excel hangs and is slow at calculating. Im guessing because are rely on A values.

Here are the formulas dragged down:

A2 - Input Data

B2
Code:
=COUNTIFS($A$2:$A2,A2,$F$2:$F2,"PASSED")/COUNTIF($A$2:$A2,A2)

C2
Code:
=IF(A2="",0,IF(ISNA(LOOKUP(2,1/($A$1:A1=A2),$G$1:G1)),0,LOOKUP(2,1/($A$1:A1=A2),$G$1:G1)))

D2
Code:
=IF(A2="",0,SUMIFS(G$2:G2,A$2:A2,A2,F$2:F2,"PASSED"))

E2
Code:
=IF(D2=0,0,IF(SUMIF(A$2:A2,A2,G$2:G2)>100,SUMIF(A$2:A2,A2,G$2:G2)-10,SUMIF(A$2:A2,A2,G$2:G2)))

F2
Code:
=IF(G2>80,"PASSED","FAILED")

G2 - Input Data


I think the problem lies mainly with the formulas in C, like i dont know if i can check for NA a better way

Appreciate any help
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,223,896
Messages
6,175,259
Members
452,626
Latest member
huntinghunter

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