Row Wise Sum [message #1926] |
Tue, 13 June 2023 10:46 |
amorrison
Messages: 38 Registered: March 2016
|
Member |
|
|
Hi,
I'm trying to do a row wise sum of several columns within a Row to get a total value. In some cases there will be a empty value within a particular row. I've tried both sum(x,y,z) and also (x+y+z), this works fine for rows that are fully populated but for rows that have a empty value I get 'NAN' returned. Can I force it to ignore this and give me the sum even when there is a empty value?
In addition, is it possible to get a count of the populated values within the row? So for example, within the row 4 out of 5 of the columns have data, the number I would like to return is "4".
Just in case this is the issue, I am using an if statement to generate the numbers with an initial if(isempty(var),"","Do something else").
Many thanks,
Angus
|
|
|