• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Divide number in column B by number in column C if they in the same category

I attached a screenshot and worksheet.
I have a list of numbers, some repetitive, that represent category groupings in column A. Column B has the lowest price amongst the category and column C has the highest price in the category. I need to divide these two numbers amongst the same category grouping and place the result in column D on the same row as the lowest price in column B. Thanks.
 

Attachments

  • worksheet2.jpg
    worksheet2.jpg
    61.9 KB · Views: 8
  • worksheet2.xlsx
    11.1 KB · Views: 7
Hi Westend9876,

I am sure you will get better answers, but you can have the below for starters..

Code:
=SUMIF($A$2:$B$25,A2,$B$2:$B$25)/SUMIF($A$2:$C$25,A2,$C$2:$C$25)
 
Just to align to your requirement, modifying Abhijeet's suggestion slightly,

=IF(B2=SUMIF($A$2:$A$25,A2,$B$2:$B$25),SUMIF($A$2:$A$25,A2,$B$2:$B$25)/SUMIF($A$2:$A$25,A2,$C$2:$C$25),"")
 
Thank Abhi and Sam. They both work great. I modified Abhi's a bit to achieve the same result submitted by Sam. This appears to do the same for the alignment with a bit less. You guys are so good. Much appreciated.
=IF(B2="","",SUMIF($A$2:$B$25,A2,$B$2:$B$25)/SUMIF($A$2:$C$25,A2,$C$2:$C$25))
 
Back
Top