Forum Discussion

Hogstad_Raadgivning's avatar
Hogstad_Raadgivning
Iron Contributor
Nov 06, 2019

Why does this funcyion return zero wwhen the cell i empty.

Hi,

 

This is the situation. In this project we have 3 tablers.

1 for a weekplan (mon -> Sun) that table is a combination of

A Projectplan and a

A Otherplan (that includes Vacations, Training, Inspection....)

 

These tables has columns from Mon1 Tue1......... Fri52 Sat52 Where the number is the week number.

 

It works, but it return a 0 if the  the specified row in Mon1 is empty.

 

Function
=TEXT.COMBINE(" - ";TRUE;IF(t_teamleder[AnsattID]=[@AnsattID];INDIRECT("t_teamleder[Mon"&$I$2&"]");"");HVIS(t_montasje[AnsattID]=[@AnsattID];INDIRECT("t_montasje[Mon"&$I$2&"]");""))

 

So I search in each table, on the wanted column (INDIRECT), and return text if there is an EmployeID Match (AnsattID), and combine the text in one cell.

 

The result:

If it find somtehing in a Cell, it return the wanted text. If the cell is Empy, a 0 is returned

 

Why the 0?

 

Best Regards

- Geir

 

4 Replies

      • Patrick2788's avatar
        Patrick2788
        Silver Contributor

        Hogstad_Raadgivning 

        Are those cells really empty or are they maybe 0s formatted to display as blank? I'd check the value displayed in the formula bar.

         

        One way to pull out the 0s in the joined string (Small example, change the ranges accordingly) :

         

        =SUBSTITUTE(TEXTJOIN(" - ",TRUE,A1:C1),"0 -","")

Resources