How to take the highest of 2 numbers for division over the smaller
Hi all!
I have two columns I would like to divide, however, it has to be the high number divided by low number. See my attachment.
For example because FirstNew is a bigger number, it will have to be 5/3
However, in some cases the bigger number could be in FirstOld which would have to be 7/3
What would be the formula so that it will automatically pick the largest number to be divided by the smallest? Thank you!
Best Answer
-
Hey @Robert K
Try this
=IF(AND(ISNUMBER(FirstOld@row), ISNUMBER(FirstNew@row)), IF(FirstOld@row >=FirstNew@row, FirstOld@row / FirstNew@row, FirstNew@row / FirstOld@row))
First, the formula checks to make sure both columns are populated then it checks to see if FirstOld is larger than FirstNew. If it is, it does the math, otherwise, it swaps to the opposite column as the numerator.
Will this work for you
Kelly
Answers
-
Hey @Robert K
Try this
=IF(AND(ISNUMBER(FirstOld@row), ISNUMBER(FirstNew@row)), IF(FirstOld@row >=FirstNew@row, FirstOld@row / FirstNew@row, FirstNew@row / FirstOld@row))
First, the formula checks to make sure both columns are populated then it checks to see if FirstOld is larger than FirstNew. If it is, it does the math, otherwise, it swaps to the opposite column as the numerator.
Will this work for you
Kelly
-
Thank you Kelly! It works
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 66.2K Get Help
- 431 Global Discussions
- 150 Industry Talk
- 490 Announcements
- 5.2K Ideas & Feature Requests
- 85 Brandfolder
- 154 Just for fun
- 74 Community Job Board
- 500 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 306 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!