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!
 

Some videos you may like

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201

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.
 
Joined
Jul 15, 2015
Messages
7
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,518
Messages
5,596,630
Members
414,082
Latest member
sasmita

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
Top