multiple if

vapana

New Member
Joined
Feb 11, 2023
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi, i have 4 numbers in 4 cells and i want to compare the numbers to find the largest. If the first number is greater, give 1, if the second number is greater , give 2, if the third number is greater, give 3. otherwise give 4. Would you please let me know how i can do this in Excel. Thank you kindly.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hi & welcome to MrExcel.
How about
Excel Formula:
=MATCH(MAX(A2:A5),A2:A5,0)
 
Upvote 0
Hi, i have 4 numbers in 4 cells and i want to compare the numbers to find the largest. If the first number is greater, give 1, if the second number is greater , give 2, if the third number is greater, give 3. otherwise give 4. Would you please let me know how i can do this in Excel. Thank you kindly.
1676133695650.png
 
Upvote 0
In that case use
Excel Formula:
=MATCH(MAX(C5:F5),C5:F5,0)
 
Upvote 0
hi, i tried the formula you provided. it works great. but i got a new twist in what i want. please see below. Thank you so much.

1676134938768.png
 
Upvote 0
catagory 3 has a higher value that catagory 1, even though cell c5=E5.
 
Upvote 0
How about
Excel Formula:
=XMATCH(MAX(C5:F5),C5:F5,0,-1)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,616
Messages
6,125,865
Members
449,266
Latest member
davinroach

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top