Largest number in column and conditional

Status
Not open for further replies.

SunValley

New Member
Joined
Jul 12, 2023
Messages
45
Office Version
  1. 365
Platform
  1. Windows
I've been trying to combine IF and LARGE but I'm not getting the formula right.
=IF(A2=LARGE(A2:A22;1);"X";"Y")

If the A2 cell has the first largest number before the first dot in column A, name "X" is returned, if not, return "Y".
For example: if column A contains in each cell, 5.0, 5.1, 5.2, 3.0, 2.0, 1.0 , then it means that 5.0, 5.1 and 5.2 will be considered as "First largest number".

Although 5.3 is greater than 5.1 and 5.0, only what is before the dot is important, so both 5.3, 5.1, and 5.0 would return "X" because they are the first largest number in the column before the first dot.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Without seeing your data, I would begin by adding $ to the Row indicators for the LARGE function.
Also try to replace the semi-colons with commas, if necessary.
Excel Formula:
=IF(A2=LARGE(A$2:A$22;1),"X","Y")
 
Upvote 0
I used the formula you provided, but it's giving an error

1689886318226.png
 
Upvote 0
Without seeing your data, I would begin by adding $ to the Row indicators for the LARGE function.
Also try to replace the semi-colons with commas, if necessary.
Excel Formula:
=IF(A2=LARGE(A$2:A$22;1),"X","Y")
The formula I provided was correct, but for some reason it was resulting in an error.
=IF(A2=LARGE(A2:A22;2);"X";"Y")

However, it doesn't recognize the cells as a number if I use information like "1.0" instead of "1",
the formula doesn't work. Excel doesn't seem to recognize numbers if they're followed by a dot. I don't know where to fix it.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,215,165
Messages
6,123,391
Members
449,098
Latest member
ArturS75

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