ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF function....testing against values in multiple cells (https://www.excelbanter.com/excel-worksheet-functions/50071-if-function-testing-against-values-multiple-cells.html)

racmb1975

IF function....testing against values in multiple cells
 
Is there a way of writing an IF function to test the values in 3 cells and
return a message depending on which cell has the highest value?
For example if A1 = 1000, B1 = 1500, C1 = 1750. If A1 is has the largest
value then I would like a return of "Charlie is leading", if B1 is higher
then return "Scott is leading" and if C1 is highest then return "Jason is
leading" .....is it possible to write this function?

Shatin

=IF(MAX(A1,B1,C1)=A1,"Charlie is leading",IF(MAX(A1,B1,C1)=B1,"Scott is
leading","Jason is leading"))

"racmb1975" wrote in message
...
Is there a way of writing an IF function to test the values in 3 cells and
return a message depending on which cell has the highest value?
For example if A1 = 1000, B1 = 1500, C1 = 1750. If A1 is has the largest
value then I would like a return of "Charlie is leading", if B1 is higher
then return "Scott is leading" and if C1 is highest then return "Jason is
leading" .....is it possible to write this function?




Shatin

On further thought, the formula may not always be correct. What if there is
a tie, say both A1 and B1 are equal to 2000? What message do you want to
return?

"Shatin" wrote in message
...
=IF(MAX(A1,B1,C1)=A1,"Charlie is leading",IF(MAX(A1,B1,C1)=B1,"Scott is
leading","Jason is leading"))

"racmb1975" wrote in message
...
Is there a way of writing an IF function to test the values in 3 cells

and
return a message depending on which cell has the highest value?
For example if A1 = 1000, B1 = 1500, C1 = 1750. If A1 is has the largest
value then I would like a return of "Charlie is leading", if B1 is

higher
then return "Scott is leading" and if C1 is highest then return "Jason

is
leading" .....is it possible to write this function?







All times are GMT +1. The time now is 10:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com