If cell in range contains ANY text, return value of that cell

ajoshi87

New Member
Joined
Apr 13, 2011
Messages
12
Hello everyone,

I have a range of cells A2:A15 and I would like to write a formula that says, if there is a cell from A2:A15 that has ANY text, return the value of that cell.

As a caveat, that range of will never have 2 cells that have text.

Any help writing this formula would be appreciated :)
 
Hello everyone,

I have a range of cells A2:A15 and I would like to write a formula that says, if there is a cell from A2:A15 that has ANY text, return the value of that cell.

As a caveat, that range of will never have 2 cells that have text.

Any help writing this formula would be appreciated :)
What version of Excel are you using?
 
Upvote 0
=LEFT(A2,20) this will return up to 20 characters or you can change 20 to any number that you want then just drag the formula down.
 
Upvote 0
@Jade, thank you for the suggestion! Is there a way this could work for a range? So for A2:A15 instead of just A2?
 
Upvote 0
Try this...

=IFERROR(INDEX(A2:A15,MATCH("*",A2:A15,0)),"")

@T. Valko - that unfortunately did not work - it still returns a blank cell even if there is text in cell A14. Is there something I should be writing in for the "*" or is it ok to leave that as is?
 
Upvote 0
@T. Valko - that unfortunately did not work - it still returns a blank cell even if there is text in cell A14. Is there something I should be writing in for the "*" or is it ok to leave that as is?

@AJOSHI: Formula is working properly...

Excel Workbook
A
11
22
33
42
5Kamran
62
73
86
95
104
117
12
13Kamran
Sheet3
 
Upvote 0
@proficient,

I just tried it in a blank sheet and yes the formula is working. Unfortunately, when I input the same formula into my actual worksheet it does not work. Just as a reference, cells A2:A15 are formulas as well instead of raw inputted text - would this make a difference?
 
Upvote 0
@proficient,

I just tried it in a blank sheet and yes the formula is working. Unfortunately, when I input the same formula into my actual worksheet it does not work. Just as a reference, cells A2:A15 are formulas as well instead of raw inputted text - would this make a difference?
You said you were looking for any TEXT so the formula I suggested is looking specifically for TEXT. If you have formulas that return formula blanks "" these are actually TEXT entries and the formula I suggested will "see" these blanks. So, let's try something different.

Try this array formula**:

=IFERROR(INDEX(A2:A15,MATCH(TRUE,A2:A15<>"",0)),"")

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.

This formula will look for cells that do not contain blanks.
 
Upvote 0

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