Is there a more efficient formula to do the same?

Status
Not open for further replies.

Newbie73

Board Regular
Joined
Feb 4, 2024
Messages
109
Office Version
  1. 365
Platform
  1. Windows
Hello everyone, I have this formula that works perfectly but I was just wondering if there is a more efficient way of achieving the same? I know that Excel can struggle with loads of data, but due to my company I need to carry out work in it instead of SQL or something similar, so was just wondering as these formulas are really hitting hard the spreadsheet in terms of loading and calculating for any change. Maybe there isn't but just thought in giving it a try with more knowledgeable people in it

Example sheet:

Test.xlsx

A is Dates
C is IDs
D is grades
F to I different list of IDs that some will match and shows if a ID is "R" or "IR"

K and L checks if the IDs on C are present in between F and I

And then the problem starts with a heavy (but required formula)

It checks if an ID which is "R" (K) and then compared the chanceof the animals having a Grade (Column D) different than "B0" and the chance of that happening between 7 days both ways of the respective date in A.

Example of the formula:

=IF(K2:K10000="R",MAP(A2:A10000,LAMBDA(m,LET(c,D2:D10000,d,A2:A10000,k,(d>=m-7)*(d<=m+7)*(m<>d),IFERROR(SUM(k*(c<>"B0"))/SUM(k),0)))),"")

As I said the formula work wonders exactly as I want to, but it's really heavy plus it has small different variations as you can see after Column N and the original spreadsheet has even more variations and a bigger data pool to do it. Maybe there's nothing that could do the same but easier on the CPU, but just thought in giving it a try.

Thank you in advance for your time and let me know if I didn't explain myself correctly or if you need any more information.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Sorry I should have used the original thread, my bad:

 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,223,883
Messages
6,175,167
Members
452,615
Latest member
bogeys2birdies

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