# Identify max value, divide others by half, then total all

This may be too specific of a formula, but I'm hoping there is a function or script that will accomplish it.

I need a Google Sheet to identify the largest number in a row and divide all of the OTHER numbers by 2, then add the entire row together.

Example: Row 1 has the following numbers... 100, 200, and 300
I would like the sheet to identify 300 as the largest number, divide 100 & 200 in half (50 & 100), then total the whole row together to get 450.

Is this possible?

``````=SUM(MAX(B12:12), ARRAYFORMULA(QUERY(TRANSPOSE(B12:12),
"select Col1 where not Col1 contains '"&MAX(B12:12)&"'")/2))``````

``````=SUM(MAX(SPLIT(B12; ", ")); ARRAYFORMULA(QUERY(TRANSPOSE(SPLIT(B12; ", "));
"select Col1 where not Col1 contains '"&MAX(SPLIT(B12; ", "))&"'")/2))``````

• Thanks for the answer, Mark. Let me clarify one thing, however, as it may change the formula. The numbers will be input on the same row, but each number in a different column (ie-A12 "100", B12 "200", C12 "300")
– Tera
Jan 23 '19 at 16:08

Let me give this a crack:

``````=(SUM(B2:2)-MAX(B2:2))/2 + MAX((B2:2))
``````

Presuming all the data is in the one row, the above should work, just drag it down. Should be easier to understand too.

The idea is to sum the whole row, subtract the largest number, divide that total by two then add the largest number back in.