Return Highest value if Range of cells dont contain "Sat" or "Sun"

TheEnergyMan

New Member
Joined
Mar 12, 2019
Messages
12
[TABLE="width: 331"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Occupancy[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Occupancy Start[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Occupancy End[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Occupancy Start Weekend[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Occupancy End Weekend[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]DHW[/TD]
[TD]DHW[/TD]
[/TR]
[TR]
[TD]DHW Start Monday[/TD]
[TD]05:00[/TD]
[/TR]
[TR]
[TD]DHW Start Tues - Fri[/TD]
[TD]05:30[/TD]
[/TR]
[TR]
[TD]DHW Stop Mon - Thurs[/TD]
[TD]15:00[/TD]
[/TR]
[TR]
[TD]DHW Stop Fri[/TD]
[TD]15:00[/TD]
[/TR]
[TR]
[TD]DHW Start Sat[/TD]
[TD]09:00[/TD]
[/TR]
[TR]
[TD]DHW Stop Sat[/TD]
[TD]13:00[/TD]
[/TR]
[TR]
[TD]DHW Start Sun[/TD]
[TD]00:00[/TD]
[/TR]
[TR]
[TD]DHW Stop Sun[/TD]
[TD]00:00[/TD]
[/TR]
[TR]
[TD]Cylinder Temps (°C)[/TD]
[TD]61.0°C
[/TD]
[/TR]
</tbody>[/TABLE]

So, see the above in excel, 2 columns 16 rows

I am trying to use the function in Cell B3 :
{=MAX(IF(AND(B7:B609 <> 0, $A$7:$A$609 <> ISNUMBER(SEARCH("Sat",$A$7:$A$609)), $A$7:$A$609 <> ISNUMBER(SEARCH("Sun", $A7:$A609))), B7:B609)) }

To find the max value (latest time) in the range that is < 1 (so that the Temp value isn't included) and only use the cells that do not contain Sat or Sun

the formula returns 0 ??

when i Use the formula : =MAX(IF(B7:B610 < 1,B7:B610))

It works Fine but i dont want the Sat and Sunday values in there only the weekly values

thanks in advance for any help
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
See if this works:

=MAX(IF(NOT(ISNUMBER(SEARCH("sat",A1:A609))+ISNUMBER(SEARCH("sun",A1:A609))),B1:B609))
 
Upvote 0
=MAX(IF(NOT((ISNUMBER(SEARCH("Sat",A7:A609))+ISNUMBER(SEARCH("Sun",A7:A609))+ISNUMBER(SEARCH("C)",A7:A609)))),B7:B609))
Array formula, use Ctrl-Shift-Enter

Searches for "C)" to identify temperature
 
Last edited:
Upvote 0
That works but when I Add =MAX(IF(AND($A$7:$A$609 < 1,NOT(ISNUMBER(SEARCH("sat",A7:A609))+ISNUMBER(SEARCH("sun",A7:A609)))),B7:B609))

to it, it returns 0, have I Added the 'And' function correctly?

Thanks
 
Upvote 0
this work with a helper column


Book1
ABC
1Occupancy
2Occupancy Start
3Occupancy End15:00
4Occupancy Start Weekend
5Occupancy End Weekend
6DHWDHW
7DHW Start Monday05:00FALSE
8DHW Start Tues - Fri05:30FALSE
9DHW Stop Mon - Thurs15:00FALSE
10DHW Stop Fri15:00FALSE
11DHW Start Sat09:00TRUE
12DHW Stop Sat18:00TRUE
13DHW Start Sun00:00FALSE
14DHW Stop Sun00:00FALSE
15Cylinder Temps (C)61.0C
Sheet3
Cell Formulas
RangeFormula
B3{=MAX(IF(C7:C14=FALSE,B7:B14))}
C7{=ISNUMBER(SEARCH({"Sat","Sun"},A7))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0
Try...

=MAX(IF(B7:B610<1,IF(ISERROR(SEARCH("Sat",A7:A610)),IF(ISERROR(SEARCH("Sun",A7:A610)),B7:B610))))
Ctrl+Shift+Enter

M.
 
Upvote 0
You cant use AND in an array formula. It doesnt produce an array of values so cant be used. For OR use addition, or for AND use multiplication.
 
Upvote 0
=MAX(IF((A7:A609>" ")*NOT((ISNUMBER(SEARCH("Sat",A7:A609))+ISNUMBER(SEARCH("Sun",A7:A609))+ISNUMBER(SEARCH("C)",A7:A609)))),B7:B609))
Array formula, use Ctrl-Shift-Enter

What have you got in column A that you havent indicated in your example data?
 
Last edited:
Upvote 0
=MAX(IF((A7:A609>" ")*NOT((ISNUMBER(SEARCH("Sat",A7:A609))+ISNUMBER(SEARCH("Sun",A7:A609))+ISNUMBER(SEARCH("C)",A7:A609)))),B7:B609))
Array formula, use Ctrl-Shift-Enter

What have you got in column A that you havent indicated in your example data?

sorry, Im assuming you mean Row A, This is what I have (not sure how to table this
[TABLE="width: 331"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Term[/TD]
[TD]Calderglen[/TD]
[/TR]
[TR]
[TD]Occupancy[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Occupancy Start[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Occupancy End[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Occupancy Start Weekend[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Occupancy End Weekend[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]DHW[/TD]
[TD]DHW[/TD]
[/TR]
[TR]
[TD]DHW Start Monday[/TD]
[TD]05:00[/TD]
[/TR]
[TR]
[TD]DHW Start Tues - Fri[/TD]
[TD]05:30[/TD]
[/TR]
[TR]
[TD]DHW Stop Mon - Thurs[/TD]
[TD]15:00[/TD]
[/TR]
[TR]
[TD]DHW Stop Fri[/TD]
[TD]15:00[/TD]
[/TR]
[TR]
[TD]DHW Start Sat[/TD]
[TD]09:00[/TD]
[/TR]
[TR]
[TD]DHW Stop Sat[/TD]
[TD]13:00[/TD]
[/TR]
[TR]
[TD]DHW Start Sun[/TD]
[TD]00:00[/TD]
[/TR]
[TR]
[TD]DHW Stop Sun[/TD]
[TD]00:00[/TD]
[/TR]
[TR]
[TD]Cylinder Temps (°C)[/TD]
[TD]61.0°C[/TD]
[/TR]
</tbody>[/TABLE]

My top row are the different locations, then I have Different facilities for each one here shows DHW
 
Upvote 0
HI all that were Kind enough to reply, I seem to have mixed some of your reccomendations together to get something that works, it isnt that pretty but it works :')

=MAX(IF((A7:A609>" ")*NOT((ISNUMBER(SEARCH("Sat",A7:A609))+ISNUMBER(SEARCH("Sun",A7:A609))+ISNUMBER(SEARCH("Intercept",A7:A609))+ISNUMBER(SEARCH("Set",A7:A609))+ISNUMBER(SEARCH("Enable",A7:A609))+ISNUMBER(SEARCH("Setpoint",A7:A609))+ISNUMBER(SEARCH("Temp",A7:A609))+ISNUMBER(SEARCH("C)",A7:A609)))),B7:B609))

I did not know that i couldnt use the 'And' function, so thanks for letting me know that, I didnt know that i could use the '+' to include different conditions
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,226
Members
452,620
Latest member
dsubash

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