Coalesce as a formula

Roderick_E

Well-known Member
Joined
Oct 13, 2007
Messages
2,051
I have a coalesce UDF I use all the time but sometimes I forget to convert to values. Anyone have a formula that will do the same thing so if I leave it as a formula it will not break when I send to outside my Excel app?

P.S. in case someone doesn't know coalesce is usually a sql function that uses the first non-null in a list of strings. In this case, we would want:

=coalesce(cell,cell,cell...) which is how my UDF works. Thanks
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I don't know the coalesce function, where your cells might be or exactly what you mean by "break when I send to outside my Excel app" so here are a couple of guesses.

F1 if the cells are in a row or column.
F3 (requires Excel 365 & assumes | character will not be in any of the cells) if not as above.
F4 (if not Excel 365 and assuming | and # characters are not used in the cells)

Excel Workbook
ABCDEFGHIJK
1abcdefabc
2
3de f
4de f
5
6
7ab c
8
9
10
11de f
12ghi
First Non-Empty




If this is not what you are after, perhaps you could provide your existing udf and/or sample data and expected results?
It might also be useful to know about how many cells might be fed in to the function.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,954
Messages
6,122,462
Members
449,085
Latest member
ExcelError

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