Anyone can optimize these lookup / sumifs ?

JumboCactuar

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

i have the following:

NamePass RatePrevious ScoreAccumulative PointsAccumulative minus ReductionResultValue
John100.00%#DIV/0!8989PASSED89
Luke0.00%000FAILED44
George100.00%08282PASSED82
Tim100.00%09595PASSED95
Luke0.00%4400FAILED63
Fred100.00%09191PASSED91
Lisa100.00%08888PASSED88
Harry100.00%08181PASSED81
Paul100.00%08989PASSED89
George100.00%82177167PASSED95
John50.00%8989146FAILED67
Fred50.00%9191156FAILED75
Bob100.00%08282PASSED82
Paul100.00%89182172PASSED93
Tim100.00%95185175PASSED90
George66.67%95177244FAILED77
Paul100.00%93268258PASSED86
Fred66.67%75180245PASSED89
Luke0.00%6300FAILED44

<tbody>
</tbody>


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

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Maybe...

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

M.

thankyou i will try it

anything for column E? Am i better doing the SUM IF then the deduction in a seperate column?
 
Upvote 0

Forum statistics

Threads
1,215,108
Messages
6,123,133
Members
449,098
Latest member
Doanvanhieu

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