Hi
I am trying to work out a formula to use in an excel sheet I am working on, but am struggling to find one to do what I want:
Basically I want to check a range of cells, and if there are numbers in this range - return the min and max of these (easy to do using the min & max functions)
However if there are not any numbers in the range then I want to return a text value of "None" instead of a value of 0 (which it currently does)
E.G.
If I have cell values:
A1, B1, C1, D1
1, 2, 3, 4
I want to check these to see what the min and max values are
Cell E1 (Min figure =MIN(A11) = 1
Cell F1 (Max figure =MAX(A11) = 4
Fine so far, but if the values are instead:
A1, B1, C1, D1
N/A, DNS, DNF, N/A
This returns a value of 0 in E1 & F1
What I want in this case is to be able to return a text value instead (like "none") (I.e. when there are no numbers in the range - return a text value - to do this though you need to test what is in the range)
I tried to get around this by using an IF test
=IF(A11="N/A","None",IF(A11="DNF","None",IF(A11="DNS","None",MIN(A11))))
=IF(A11="N/A","None",IF(A11="DNF","None",IF(A11="DNS","None",MAX(A11))))
This is not quite right as it is testing to see if the whole of the range of A11 is equal to N/A, DNF or DNS rather than each individually (this returns a #VALUE! Response)
Any ideas what I need to do to sort this?
BTW - If I have values:
A1, B1, C1, D1
1, DNS, DNF, N/A
This works using the Min and Max functions (both return 1), however it falls over when I have no numbers in the range -so any solution must cover 3 scenarios:
All numbers in range
Some numbers in range + some of one or more of these - DNS, DNF, N/A
No numbers in the range, mix of one or more of these - DNS, DNF, N/A
Cheers - Neill
I am trying to work out a formula to use in an excel sheet I am working on, but am struggling to find one to do what I want:
Basically I want to check a range of cells, and if there are numbers in this range - return the min and max of these (easy to do using the min & max functions)
However if there are not any numbers in the range then I want to return a text value of "None" instead of a value of 0 (which it currently does)
E.G.
If I have cell values:
A1, B1, C1, D1
1, 2, 3, 4
I want to check these to see what the min and max values are
Cell E1 (Min figure =MIN(A11) = 1
Cell F1 (Max figure =MAX(A11) = 4
Fine so far, but if the values are instead:
A1, B1, C1, D1
N/A, DNS, DNF, N/A
This returns a value of 0 in E1 & F1
What I want in this case is to be able to return a text value instead (like "none") (I.e. when there are no numbers in the range - return a text value - to do this though you need to test what is in the range)
I tried to get around this by using an IF test
=IF(A11="N/A","None",IF(A11="DNF","None",IF(A11="DNS","None",MIN(A11))))
=IF(A11="N/A","None",IF(A11="DNF","None",IF(A11="DNS","None",MAX(A11))))
This is not quite right as it is testing to see if the whole of the range of A11 is equal to N/A, DNF or DNS rather than each individually (this returns a #VALUE! Response)
Any ideas what I need to do to sort this?
BTW - If I have values:
A1, B1, C1, D1
1, DNS, DNF, N/A
This works using the Min and Max functions (both return 1), however it falls over when I have no numbers in the range -so any solution must cover 3 scenarios:
All numbers in range
Some numbers in range + some of one or more of these - DNS, DNF, N/A
No numbers in the range, mix of one or more of these - DNS, DNF, N/A
Cheers - Neill