Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- JMP User Community
- :
- Discussions
- :
- Count number of columns which have value

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Apr 26, 2018 2:16 PM
(7123 views)

I have a table where I want to create a new column which tells the number of cells in that row which has a value in it. How do I do this?

My columns look like this for example:

Name, A, B, C, D

I need to know how many in A,B,C and D have values in every row. Some rows have values for all of them, and in some none of them have values.

My columns look like this for example:

Name, A, B, C, D

I need to know how many in A,B,C and D have values in every row. Some rows have values for all of them, and in some none of them have values.

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

@BhargavDS,

I am assuming you have a table that looks like this :

You can script your new formula like so :

```
If( Is Missing( :name ),0,1) + If( Is Missing( :age ), 0, 1 ) +
If( Is Missing( :sex ), 0, 1 ) + If( Is Missing( :height ),0,1) +
If( Is Missing( :weight ),0,1)
```

Best

Uday

Uday

3 REPLIES 3

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

@BhargavDS,

I am assuming you have a table that looks like this :

You can script your new formula like so :

```
If( Is Missing( :name ),0,1) + If( Is Missing( :age ), 0, 1 ) +
If( Is Missing( :sex ), 0, 1 ) + If( Is Missing( :height ),0,1) +
If( Is Missing( :weight ),0,1)
```

Best

Uday

Uday

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Count number of columns which have value

The below formula is a simpler form but gives the same results as @uday_guntupall

```
Sum(:Name == "", isMissing(:age),:sex=="",isMissing(:Height),isMissing(:Weight))
```

Jim

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Count number of columns which have value

Did you try the following formula column?

N Missing( :A, :B, :C, :D )

Article Labels

There are no labels assigned to this post.