How do I COUNT the output of the LEFT function?

Yasir

New Member
Joined
Sep 22, 2002
Messages
12
Hi:
One of the columns contains a number of values including the text string "1/2A". I am using the LEFT function to return only the "1/2" part of the string. E.g:

=LEFT(A10, 3)

I am using the LEFT function because all the values in the column have a letter after the "1/2" and a nested IF or Count IF statement is very inelegant. I would like my function to scan a column range and return a count value using the LEFT function to seperate the "1/2" from the full string (be it "1/2A" or "1/2B" etc. Any ideas?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
On 2002-11-07 06:18, Yasir wrote:
Hi:
One of the columns contains a number of values including the text string "1/2A". I am using the LEFT function to return only the "1/2" part of the string. E.g:

=LEFT(A10, 3)

I am using the LEFT function because all the values in the column have a letter after the "1/2" and a nested IF or Count IF statement is very inelegant. I would like my function to scan a column range and return a count value using the LEFT function to seperate the "1/2" from the full string (be it "1/2A" or "1/2B" etc. Any ideas?

=SUMPRODUCT(ISNUMBER(LEFT(A10:A20,3)+0)+0)

would count entries whose first three chars together can be interpreted as number.

Is this what you're looking for?
 
Upvote 0
On 2002-11-07 06:51, Aladin Akyurek wrote:
On 2002-11-07 06:18, Yasir wrote:
Hi:
One of the columns contains a number of values including the text string "1/2A". I am using the LEFT function to return only the "1/2" part of the string. E.g:

=LEFT(A10, 3)

I am using the LEFT function because all the values in the column have a letter after the "1/2" and a nested IF or Count IF statement is very inelegant. I would like my function to scan a column range and return a count value using the LEFT function to seperate the "1/2" from the full string (be it "1/2A" or "1/2B" etc. Any ideas?

=SUMPRODUCT(ISNUMBER(LEFT(A10:A20,3)+0)+0)

would count entries whose first three chars together can be interpreted as number.

Is this what you're looking for?

Aladin you are a star! Thanks so much for your help, it worked perfectly. I'm now going to check what SUMPRODUCT and ISNUMBER functions are, as I've never come across them before. Thanks again.

Yasir
 
Upvote 0
On 2002-11-07 06:51, Aladin Akyurek wrote:


=SUMPRODUCT(ISNUMBER(LEFT(A10:A20,3)+0)+0)

would count entries whose first three chars together can be interpreted as number.

Is this what you're looking for?

One other question if anybody knows. How would you adapt the function if the column being scanned contains other values which do not begin with the text string "1/2". For example there may be 2/3, 3/4, 1/8 etc? Is there a way to:
a) Scan the column for only the partial text string "1/2"
b) Return the value as a number
c) Count the values

All help greatly appreciated.

Thanks,
Yasir
 
Upvote 0
On 2002-11-07 07:29, Yasir wrote:
On 2002-11-07 06:51, Aladin Akyurek wrote:


=SUMPRODUCT(ISNUMBER(LEFT(A10:A20,3)+0)+0)

would count entries whose first three chars together can be interpreted as number.

Is this what you're looking for?

One other question if anybody knows. How would you adapt the function if the column being scanned contains other values which do not begin with the text string "1/2". For example there may be 2/3, 3/4, 1/8 etc? Is there a way to:
a) Scan the column for only the partial text string "1/2"
b) Return the value as a number
c) Count the values

All help greatly appreciated.

Thanks,
Yasir

Not sure I understood your questions as intended, but try...

Let A10:A20 be the range of interest.

We are only interested in the number part of the entries in A10:A20.

In B10 enter & copy down:

=LEFT(A10,3)

In C10 enter & copy down:

=IF(ISNUMBER(SEARCH("/",A10)),EVAL(LEFT(A10,3)),"")

EVAL is part of the morefunc.xll add-in, downloadable from:

http://longre.free.fr/english/index.html


See...
aaCondCountQ Yasir.xls
ABCDEF
9
101/2a1/21/21/3
111/3b1/31/31
12xx 
132/3d2/32/3E10isformatted
142/5e2/52/5astextbefore
152/3a2/32/3entering1/3
16yy 
171010 
18  
19  
202/3f2/32/3
21
Sheet1

This message was edited by Aladin Akyurek on 2002-11-07 09:34
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,839
Members
449,051
Latest member
excelquestion515

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