In column M how can I apply a 1 to the top 82 ranked values as defined in column L

In column M how can I apply a 1 to the top 82 ranked values as defined in column L
Example_LaborDistribution.xlsx
Ryan SimmonsBusiness Analyst IIIAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rgonzo1971Commented:
Hi,

pls try
Sub macro()

For Idx = 1 To 82
Set Rng = Range(Range("L2"), Range("L" & Rows.Count).End(xlUp))
    For Each c In Rng
        If Idx1 < Idx And c.Offset(, 1) = "" And c = WorksheetFunction.Large(Rng, Idx) Then
           c.Offset(, 1) = 1
           Idx1 = Idx1 + 1
        End If
    Next
Next
End Sub

Open in new window

Regards
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Maybe this...
In M2
=IF(L2>=LARGE($L$2:$L$503,82),1,"")

Open in new window

And then copy it down.
0
Rgonzo1971Commented:
@Neeraj The problem with the formula you get 90 values (8 more)
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Rgonzo1971Commented:
then try
=IF(AND(SUM($M$2:M62)<=83,L62>=LARGE($L$2:$L$503,82)),1,"")

Open in new window

Regards
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
@Rgonzo
Well in that case, the following formula will produce the output as same as produced by the code suggested by you.
In M2
=IF(ROWS(M$2:M2)<=82,1,"")

Open in new window

0
Rgonzo1971Commented:
@ neeraj in this example yes but the data is not sorted

then try corrected formula in M2
=IF(AND(SUM($M$2:M2)<=82,L2>=LARGE($L$2:$L$503,82)),1,"")

Open in new window

and fill down

Regards
0
Ryan SimmonsBusiness Analyst IIIAuthor Commented:
Thanks that worked.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.