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

TheEnergyMan

New Member
Joined
Mar 12, 2019
Messages
12
Occupancy
Occupancy Start
Occupancy End
Occupancy Start Weekend
Occupancy End Weekend
DHWDHW
DHW Start Monday05:00
DHW Start Tues - Fri05:30
DHW Stop Mon - Thurs15:00
DHW Stop Fri15:00
DHW Start Sat09:00
DHW Stop Sat13:00
DHW Start Sun00:00
DHW Stop Sun00:00
Cylinder Temps (°C)61.0°C

<colgroup><col><col></colgroup><tbody>
</tbody>

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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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
TermCalderglen
Occupancy
Occupancy Start
Occupancy End
Occupancy Start Weekend
Occupancy End Weekend
DHWDHW
DHW Start Monday05:00
DHW Start Tues - Fri05:30
DHW Stop Mon - Thurs15:00
DHW Stop Fri15:00
DHW Start Sat09:00
DHW Stop Sat13:00
DHW Start Sun00:00
DHW Stop Sun00:00
Cylinder Temps (°C)61.0°C

<colgroup><col><col></colgroup><tbody>
</tbody>

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,214,832
Messages
6,121,845
Members
449,051
Latest member
excelquestion515

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