# Excel formula to determine Max value

Hi,
I wish to have a formula to place max value of a column in every row.
Many thanks
Ian
###### 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.

Excel & VBA ExpertCommented:
You forgot to attach the sample workbook.
retiredAuthor Commented:
Sorry, forgot to press the 'upload' button
Here it is.
Thanks
Ian
MaxValueFormula.xlsx
Excel & VBA ExpertCommented:
Please try one of the following two formulas...

1) Array Formula which will require confirmation with Ctrl+Shift+Enter instead of Enter alone.
In C2
``````=MAX(IF(\$A\$2:\$A\$12=A2,\$B\$2:\$B\$12))
``````
and then copy down.

2) Regular formula....
In C2
``````=MAX(INDEX((\$A\$2:\$A\$12=A2)*(\$B\$2:\$B\$12),0))
``````
and copy down.

For details refer to the attached.
MaxValueFormula.xlsx

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.

Commented:
I believe this is what you are looking for..

=MAX(IF(\$A\$2:\$A\$12=D14,\$C\$2:\$C\$12,0))

Where d14 has the value 1..You need to enter this formula by ctrl+shift+enter..

Enclosed is your workbook for your reference..

Saurabh...
MaxValueFormula.xlsx
Mechanical EngineerCommented:
If you have Excel 2010 or later, you can use the AGGREGATE function in formula like this:
=AGGREGATE(14,6,B\$2:B\$12/(A\$2:A\$12=1),1)

In the above formula, the first "1" is the event you are trying to match. The second "1" should not be changed, and merely means to return the largest value.

The above formula does not need to be array-entered.
retiredAuthor Commented:
Hi Sktneer,
Thanks, the 2nd "Regular Formula" worked a treat.
Ian
Excel & VBA ExpertCommented:
You're welcome Ian! Glad I was able to help. :)
###### 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 Excel

From novice to tech pro — start learning today.