Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
get max or min number
i have these numbers
-3 2 1 i want the maximum absolute number but i want to retain the sign afterwards. So i put =MAX(ABS(G81:I81)) but that returns 3 and not -3 how do i tell the formula to also return the correct sign of the maximum absolute number in a range of numbers? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
get max or min number
try this array entered formula
=MAX(IF(ABS(E2:E4)0,ABS(E2:E4))) -- Don Guillett Microsoft MVP Excel SalesAid Software "Karish" wrote in message ... i have these numbers -3 2 1 i want the maximum absolute number but i want to retain the sign afterwards. So i put =MAX(ABS(G81:I81)) but that returns 3 and not -3 how do i tell the formula to also return the correct sign of the maximum absolute number in a range of numbers? |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
get max or min number
One way
=INDEX(G81:I81,MATCH(MAX(ABS(G81:I81)),ABS(G81:I81 ),0)) entered with ctrl + shift & enter -- Regards, Peo Sjoblom "Karish" wrote in message ... i have these numbers -3 2 1 i want the maximum absolute number but i want to retain the sign afterwards. So i put =MAX(ABS(G81:I81)) but that returns 3 and not -3 how do i tell the formula to also return the correct sign of the maximum absolute number in a range of numbers? |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
get max or min number
Here's one way:
=IF(MAX(G81:I81)<MAX(ABS(G81:I81)),-1,1)*MAX(ABS(G81:I81)) Hope this helps. Pete On Oct 24, 11:08 pm, Karish wrote: i have these numbers -3 2 1 i want the maximum absolute number but i want to retain the sign afterwards. So i put =MAX(ABS(G81:I81)) but that returns 3 and not -3 how do i tell the formula to also return the correct sign of the maximum absolute number in a range of numbers? |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
get max or min number
Array entered Ctrl + Shift + Enter
=IF(MAX(C1:C6)=MAX(ABS(C1:C6)),MAX(C1:C6),MAX(ABS( C1:C6))*-1) Regards Peter "Karish" wrote: i have these numbers -3 2 1 i want the maximum absolute number but i want to retain the sign afterwards. So i put =MAX(ABS(G81:I81)) but that returns 3 and not -3 how do i tell the formula to also return the correct sign of the maximum absolute number in a range of numbers? |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
get max or min number
Array enter (Ctrl+Shift+Enter) this formula...
=SIGN(G81:I81)*MAX(ABS(G81:I81)) Rick "Karish" wrote in message ... i have these numbers -3 2 1 i want the maximum absolute number but i want to retain the sign afterwards. So i put =MAX(ABS(G81:I81)) but that returns 3 and not -3 how do i tell the formula to also return the correct sign of the maximum absolute number in a range of numbers? |
#7
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
get max or min number
Array enter (Ctrl+Shift+Enter) this formula...
=SIGN(G81:I81)*MAX(ABS(G81:I81)) Never mind... it doesn't work... my sample data was fooling me. Rick |
#8
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
get max or min number
If you want a non-array entered solution, this formula will do that...
=SIGN(ABS(MAX(G81:I81))-ABS(MIN(G81:I81)))*(ABS(MAX(G81:I81))+ABS(MIN(G81: I81))+ABS(ABS(MAX(G81:I81))-ABS(MIN(G81:I81))))/2 Rick "Karish" wrote in message ... i have these numbers -3 2 1 i want the maximum absolute number but i want to retain the sign afterwards. So i put =MAX(ABS(G81:I81)) but that returns 3 and not -3 how do i tell the formula to also return the correct sign of the maximum absolute number in a range of numbers? |
#9
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
get max or min number
If you want a non-array entered solution, this formula will do that...
=SIGN(ABS(MAX(G81:I81))-ABS(MIN(G81:I81)))*(ABS(MAX(G81:I81))+ABS(MIN(G81: I81))+ABS(ABS(MAX(G81:I81))-ABS(MIN(G81:I81))))/2 Rick And, of course, it returns a wrong answer if the largest and smallest values have the same absolute magnitude. We can patch it like this, I guess... =SIGN(0.000000000000001+ABS(MAX(A1:A3))-ABS(MIN(A1:A3)))*(ABS(MAX(A1:A3))+ABS(MIN(A1:A3))+ ABS(ABS(MAX(A1:A3))-ABS(MIN(A1:A3))))/2 Depending on the size of the numbers being compared, we might be able to make that constant shorter (for example, if the values being compared are integers, then the constant could be 0.1). The above formula favors the positive value when the extremes have the same magnitude. Rick |
#10
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
get max or min number
Okay, ignore all my other attempts... even though the last modification I
posted will work, there is a much simpler and more straightforward formula to do what you want. This non-array, normally entered formula should do the trick... =IF(ABS(MIN(G81:I81))ABS(MAX(G81:I81)),MIN(G81:I8 1),MAX(G81:I81)) (See what a little rest period can do for the thinking processes.<g) As with my other formula, this one returns the positive value if there is a tie in magnitude between the largest negative and positive values. Rick "Karish" wrote in message ... i have these numbers -3 2 1 i want the maximum absolute number but i want to retain the sign afterwards. So i put =MAX(ABS(G81:I81)) but that returns 3 and not -3 how do i tell the formula to also return the correct sign of the maximum absolute number in a range of numbers? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
countif formula to find the occurances of a number that is greater than one number but less than another | Excel Discussion (Misc queries) | |||
convert text-format number to number in excel 2000%3f | Excel Discussion (Misc queries) | |||
Count number of times a specific number is displayed in a cell ran | Excel Worksheet Functions | |||
excel format cells/Number/Category: Number problem | Excel Discussion (Misc queries) | |||
Rounding a number to a multiple quantity that adds to a fixed total number | Excel Worksheet Functions |