The syntax for counting the number of unique values from a list of a column using the array formula is as follows: =SUM(IF(COUNTIF(<first cell from which you count the number of unique values>:<last ...
You can make a bar graph in Excel by first selecting the range you want to depict, and then using the dropdown menu to select the desired chart.