Fractions - Adding total then showing how many out of them are 'Greens'

Excel_User_10k

Board Regular
Joined
Jun 25, 2022
Messages
98
Office Version
  1. 2021
Platform
  1. Windows
In the area highlighted in the Screenshot, there are two grey Cells. The top one if a fraction that I want to show how many Greens there are out of all Greens, Ambers, Reds and Blues added together. So if there were 2 Greens, 1 Yellow, 1 Red, 1 Blue, it would say "2/5". I have the formula showing in the other Screenshot, highlighting the part concerning to the month that is selected (as the rest of the formula is only relevant when any of the other months is selected in the drop down box). It basically says Divide [Green] by how many there are when adding [Green], [Yellow], [Red], and [Blue]. However sometimes, especially if there are 0 Greens, it does not seem to understand. Whereas I would expect it to say "0/5" for instance, it will say something random like "0/3" even though there are still a total of 5. I suspect this is because it would be dividing the total by 0, which obviously is not mathematically sound. However, I do not know how else to write the formula to tell it this. Any ideas?
 

Attachments

  • 1664910872080.png
    1664910872080.png
    215.8 KB · Views: 13
  • 1664910887450.png
    1664910887450.png
    225 KB · Views: 14

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top