ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   differentiating between formulas and values (https://www.excelbanter.com/excel-discussion-misc-queries/34168-differentiating-between-formulas-values.html)

shellshock

differentiating between formulas and values
 

I have a bunch of values in column A. In column B, I'm using a
user-defined function that processes the values in column A and returns
either text of some sort or a blank.

However, even though the cells in column B appear to be unique -- well,
except for the blank cells -- the formula in each cell is essentially
identical (e.g. B1 is =UDF(A1), B2 is =UDF(A2) etc.).

I want to do an operation only on those cells in column B that are
displaying text, but I don't know how to do that automatically.

Is there a way to somehow differentiate between cells that return a
"tangible" value, and those that return a "blank" value?


--
shellshock
------------------------------------------------------------------------
shellshock's Profile: http://www.excelforum.com/member.php...o&userid=24935
View this thread: http://www.excelforum.com/showthread...hreadid=385124


ScottO

One way that should work ...

If you use Auto Filter to filter out the Blanks, then you can select your
range in ColB and use Select Special Visible Cells Only and then operate on
the Tangible cells.

Rgds,
ScottO

"shellshock" wrote
in message ...
|
| I have a bunch of values in column A. In column B, I'm using a
| user-defined function that processes the values in column A and returns
| either text of some sort or a blank.
|
| However, even though the cells in column B appear to be unique -- well,
| except for the blank cells -- the formula in each cell is essentially
| identical (e.g. B1 is =UDF(A1), B2 is =UDF(A2) etc.).
|
| I want to do an operation only on those cells in column B that are
| displaying text, but I don't know how to do that automatically.
|
| Is there a way to somehow differentiate between cells that return a
| "tangible" value, and those that return a "blank" value?
|
|
| --
| shellshock
| ------------------------------------------------------------------------
| shellshock's Profile:
http://www.excelforum.com/member.php...o&userid=24935
| View this thread: http://www.excelforum.com/showthread...hreadid=385124
|



Earl Kiosterud

Shell,

In Excel, there isn't any Tangible property, and we get together once a week
and communally lament that there is no NULL value that can be returned from
a formula or function. But you can test for the UDF returning text with:

=ISTEXT(A2)

Or look for a zero-length string with

=LEN(A2)=0

=IF(LEN(A2)0, "There's a string", "Empty string")

Or look for a number:

=ISNUMBER(A2)
--
Earl Kiosterud
www.smokeylake.com/
-------------------------------------------

"shellshock" wrote
in message ...

I have a bunch of values in column A. In column B, I'm using a
user-defined function that processes the values in column A and returns
either text of some sort or a blank.

However, even though the cells in column B appear to be unique -- well,
except for the blank cells -- the formula in each cell is essentially
identical (e.g. B1 is =UDF(A1), B2 is =UDF(A2) etc.).

I want to do an operation only on those cells in column B that are
displaying text, but I don't know how to do that automatically.

Is there a way to somehow differentiate between cells that return a
"tangible" value, and those that return a "blank" value?


--
shellshock
------------------------------------------------------------------------
shellshock's Profile:
http://www.excelforum.com/member.php...o&userid=24935
View this thread: http://www.excelforum.com/showthread...hreadid=385124




shellshock


Scott, that's a neat idea with the autofilter, although I would need to
write a macro in order for that to happen automatically. (My file is
updated on an ongoing basis by several people, and I wouldn't want to
have to do that operation manually.)

Earl, I didn't even know about the LEN function until just now -- and
I think I was only vaguely aware of the ISTEXT function. In the end, I
did something very much along those lines: (=IF(B1<"", *my operation*,
""))

Thanks very much to both of you. :)


--
shellshock
------------------------------------------------------------------------
shellshock's Profile: http://www.excelforum.com/member.php...o&userid=24935
View this thread: http://www.excelforum.com/showthread...hreadid=385124



All times are GMT +1. The time now is 02:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com