# IF condition

#### churmie

##### New Member
I need help with what should be easy formula but I can't get it right. I have the following figures:

 2 2 0 0 10 0 0

<tbody>
</tbody>

The average is 2, but I have a separate Formula which is a minimum of 2.5. How do I replace the zero values with whichever is higher of the average or the minimum?

thanks!

Last edited by a moderator:

#### James006

##### Well-known Member
Hello,

Based on your example ... what is your expected result ?

#### Yongle

##### Well-known Member
Perhaps...

=Max(average formula, minimum formula)

#### churmie

##### New Member
Hi James

The result I would expect is 2.5.

Yongle - The max formula doesn't work how I want it to. I only want to change cells with a zero value. I tried what you had but it changed values to a higher number when it wasn't a zero.

#### Yongle

##### Well-known Member
I do not understand what is being tested, but in principle
=IF(something = 0,MAX(AVG formula, MIN formula), something)
Something may be the same cell ref or the same formula)

#### churmie

##### New Member
Thanks Alan, but cell E1 changes the 10 to a 2 which I do not want. I only want to change the zero's. The figure 2.5 is a separate formula but ca also change dependent on the worksheet I am looking at

A B C D E F G MIN AVE
1 2 2 0 0 10 0 0 2 4.7
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;"> 0002ABCDEFG1220010002222.52.522.52.5</body>2 2 2 4.7 4.7 10 4.7 4.7

i need it to look like this.... Sorry for not being clear

Last edited:

#### James006

##### Well-known Member
Quite honestly ...

It is not clear at all ...

Replacing zero values by any number ... will change your average ... and create a circular reference ...

#### AlanY

##### Well-known Member
ok, try this instead

Last edited:

#### churmie

##### New Member
 A B C D E F G H I J K L M N O P Q R S T U V 1 Mon Tue Wed Thu Fri Sat Sun Min Stock Average Mon Tue Wed Thu Fri Sat Sun 2 2 2 0 0 10 0 0 2.5 4.7 2 2 4.7 4.7 10 4.7 4.7

<tbody>
</tbody>

Sorry, let's put it in a better table. Columns P-V is what I want the results to look like. Column P did not change value because it has a value already. The zero needs to be replaced with the greater of the Min Stock or Average (Column M & N).

1,082,359
Messages
5,364,916
Members
400,815
Latest member
Joaquin Phoenix

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...