# counting how many different numbers in a row

#### AmandaSS

##### Board Regular
Hi,

I am in need to find a way to calculate how m any different numbers in a row.
To explain myself I give you an example.
I have a row of 6 cells. In each cell there is a figure (which represents a price) like following:

10 20 10 10 6 20

in this row I have six cells, each of them containing a price, but only 3 different prices (10 , 20 and 6).
What I need is to create a 7th column that gives me how many different numbers are in that row. In this case 3.

Thanks a lot. I hope I was able to explain the issue
Best
Amanda

### Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi Amanda

Assuming your numbers are in A1:F1 then in G1:

=SUMPRODUCT((A1:F1<>"")/COUNTIF(A1:F1,A1:F1&""))

Richard, thanks so much

You're welcome

Replies
10
Views
340
Replies
0
Views
302
Replies
2
Views
250
Replies
2
Views
85
Replies
6
Views
153

1,217,757
Messages
6,138,429
Members
450,137
Latest member
HANHAN

### 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.

### Which adblocker are you using?

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

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