counting how many different numbers in a row

AmandaSS

Board Regular
Joined
Jan 7, 2014
Messages
133
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

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
Hi Amanda

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

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

Forum statistics

Threads
1,137,061
Messages
5,679,388
Members
419,825
Latest member
MegastarMagus

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
Top