Array formula MIN/MAX NESTED IF STATEMENT

Joined
Jul 15, 2015
Messages
7
Hi everyone,

Im having issues with a formula. I want it to be a nested if statement, so that if it says "start" then use the min formula and if it says "Stop" use max. I also want it in array format, and it was working when I had them separated (using min for start and max for stop in different formulas) but I want it all together.

This is what I have right now and I know doesn't work:
=IF(G2="Start",MIN(IF('Raw Data'!$B:$B=Sheet1!H$1,IF('Raw Data'!$A:$A=$B2,'Raw Data'!$C:$C))),IF(G2="Stop",MAX(IF('Raw Data'!$B:$B=Sheet1!H$1,IF('Raw Data'!$A:$A=Sheet1!$B107,'Raw Data'!$H:$H)))))

This worked before:

{=MAX(IF('Raw Data'!$B:$B=Sheet1!H$1,IF('Raw Data'!$A:$A=Sheet1!$B107,'Raw Data'!$H:$H)))}

and

{=MIN(IF('Raw Data'!$B:$B=Sheet1!H$1,IF('Raw Data'!$A:$A=Sheet1!$B53,'Raw Data'!$C:$C)))}

in two separate rows.

I want these two together and use MIN if it says start on the column next to it and use the MAX one if it says stop.

Hope someone is able to help me! Thank you!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Control+shift+enter, not just enter:

=IF(G2="Start",MIN(IF('Raw Data'!$B:$B=H$1,IF('Raw Data'!$A:$A=$B2,'Raw Data'!$C:$C))),IF(G2="Stop",MAX(IF('Raw Data'!$B:$B=H$1,IF('Raw Data'!$A:$A=$B107,'Raw Data'!$H:$H)))))

should work as intended. Try to avoid referencing whole columns in array-processing formulas like this one for reasons of efficiency.
 
Upvote 0
Control+shift+enter, not just enter:

=IF(G2="Start",MIN(IF('Raw Data'!$B:$B=H$1,IF('Raw Data'!$A:$A=$B2,'Raw Data'!$C:$C))),IF(G2="Stop",MAX(IF('Raw Data'!$B:$B=H$1,IF('Raw Data'!$A:$A=$B107,'Raw Data'!$H:$H)))))

should work as intended. Try to avoid referencing whole columns in array-processing formulas like this one for reasons of efficiency.


Aladin, it gives me back FALSE all across.
 
Upvote 0

Forum statistics

Threads
1,214,805
Messages
6,121,664
Members
449,045
Latest member
Marcus05

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