LEFT not working in a COUNTIF formula

TonyD1016

Board Regular
Joined
Nov 18, 2021
Messages
59
Office Version
  1. 365
Platform
  1. Windows
I have a column of data on a table that consists of 3-digit numbers.

I need to strip the third digit and count the unique instances of the remaining two digit numbers in the column.

So on another sheet in A1 I have the following:
Excel Formula:
=(LEFT(range,2)

And that spills an array of the results I need to count.
Then B and C I put the following:
Excel Formula:
=UNIQUE(A1#)
=COUNTIF(A1#,UNIQUE(A1#))
Which returns exactly the totals I need.

So I return to my first sheet and put in:
Excel Formula:
=UNIQUE(LEFT(range,2))
It works fine, but when I go to the adjacent column and try to type the following:
Excel Formula:
=COUNTIF((LEFT(range,2),UNIQUE(LEFT(range,2)))
...I get the Excel stop warning of "There's a problem with this formula."

What gives?
 
As the values are text it is looking for anything that starts with (for instance) 08
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,731
Messages
6,126,537
Members
449,316
Latest member
sravya

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