Recognising Number or Letters

Steve 1962

Active Member
Joined
Jan 3, 2006
Messages
351
Office Version
  1. 365
Platform
  1. Windows
Hi

How do I get an IF statement to handle numbers differently to letters.

EG:

IF(A1=a number, then it does this......
IF(A1=a letter, then it does this.......

Thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
try this:
=IF(ISNUMBER(C1),"it is anumber",IF(ISTEXT(C1),"it is text","it is neither"))
 
Upvote 0
Hi

Just another -

Just need a formula that counts the values in column L (sequentially down the page) that have text, then return the answer in column K (values in column L are generated by a formula). If the cells in L are blank or have numbers, then return a blank.

Image attached.

Thanks
 

Attachments

  • Example.PNG
    Example.PNG
    115.3 KB · Views: 10
Upvote 0
Put this array formula (confirm it with CTRL+ENTER) in K1 and drag down

=CHOOSE(ISTEXT(L1)*(L1<>"")+1,"",SUM(ISTEXT(L$1:L1)*(L$1:L1<>"")))
 
Upvote 0
You could try this standard formula in K2, copied down.

=IF(COUNTIF(L2,"?*"),COUNTIF(L$2:L2,"?*"),"")
 
Upvote 0
Hi All

You people amaze me. You are so helpful and clever when it comes to this stuff. Keep up the great work and have a good week.

Thanks
 
Upvote 0
Just one further question to help me understand -

What is the significance of the "?*", in the formula ?

Thanks
 
Upvote 0
You're welcome.


What is the significance of the "?*", in the formula ?
Both characters are wild cards. ? stands for a single text character. * stands for any number of characters, including none. If we left the ? out then the COUNTIF would count your formula results of "" as text cells, which you don't want. So the combination of ?* means "1 or more text characters"

So =IF(COUNTIF(L3,"?*"),COUNTIF(L$2:L3,"?*"),"") in words says

If L3 contains 1 or more text characters then count how many cells in column L from the top down to the formula cell contain 1 or more text characters else return ""
 
Upvote 0

Forum statistics

Threads
1,215,575
Messages
6,125,620
Members
449,240
Latest member
lynnfromHGT

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