Replacing If with Max

Velven

New Member
Joined
Nov 30, 2017
Messages
37
Hello Guys ,

As I heard that Max formula is the quicker formula , I was thinking I would like to speed up my workbook.

This the sample.

Sheet1
9/19/29/39/4
AB11
AY1

<tbody>
</tbody>

Sheet2
P1st Date2nd DateStatus
B9/19/4A
Y9/29/3
B9/1A
B9/4
Y9/29/4A

<tbody>
</tbody>

Data will be in Sheet2 while calculation will be in C2:F3.

Original Formula in C2
This is an array formula
=SUM(IF(IF(Sheet2!$D:$D=$A$2,IF(Sheet2!$A:$A=$B$2,IF(Sheet2!$B:$B>=Sheet2!$C:$C,Sheet2!$B:$B,IF(Sheet2!$C:$C>=Sheet2!$B:$B,Sheet2!$C:$C))))=C1,1))

Would love to replace this statement to MAX , is it possible ?
"IF(Sheet2!$B:$B>=Sheet2!$C:$C,Sheet2!$B:$B,IF(Sheet2!$C:$C>=Sheet2!$B:$B,Sheet2!$C:$C))"
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
This IF bit

IF(Sheet2!$B:$B>=Sheet2!$C:$C,Sheet2!$B:$B,IF(Sheet2!$C:$C>=Sheet2!$B:$B,Sheet2!$C:$C))

creates an array result, which is needed here. MAX, however applied, does not.

1. By the way, it's not a good idea to run an array-processing formula on the whole columns. Use instead definite ranges or dynamic named ranges.

2. If the performance is an issue, try to create a helper range in Sheet2 which compares 1st date and 2nd date, using MAX. Once done so, the SUM+IF count formula can be simplified.
 
Upvote 0

Forum statistics

Threads
1,215,833
Messages
6,127,161
Members
449,367
Latest member
w88mp

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