AC_DCEDH
AC_DCEDH

Reputation: 97

Excel, if value > 0, assign to 1, if not, assign to 0

enter image description hereI have a huge spreadsheet with a bunch of columns. For one of the columns, labelled "Clicks," it displays the number of clicks a person has made on a particular email. One person can click 0 or more times. I only care if there has been a click, but not how many. So, I'd like the values to be either 0 or 1.

I tried the following formula, without success (it gives me an error: Clicks must be whole number from -21...... through 21.......).

=IF(AND(H2>0), 1)

Upvotes: 0

Views: 5347

Answers (3)

kojow7
kojow7

Reputation: 11404

This should work for you:

=IF(H2>0, 1, 0)

Basically, the first parameter is the condition, the second parameter is what will be displayed if that condition is TRUE, the third parameter is what will be displayed if the condition is FALSE.

Upvotes: 1

pnuts
pnuts

Reputation: 59485

Can be achieved with a Custom format:

[>0]1;0

Upvotes: 1

Scott Craner
Scott Craner

Reputation: 152585

Use MIN, to return 0 or 1:

=MIN(H2,1)

Upvotes: 1

Related Questions