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
- 64.8K Get Help
- 434 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!