Help needed with empty cells.

Amortcal

New Member
Joined
May 5, 2002
Messages
10
I'm using the following to enter values in cell B1 on sheet 2:

=(Sheet1!A1>Sheet1!A2)*100+(Sheet1!A1=Sheet1!A2)*50

The problem is, the formula is responding to empty cells. When both cells are empty, the formula is accepting that the cells are equaled and returning a value of one. This is messing up everything. I want the formula to ignore the cell if the cell is empty. What should I do?

Thanks.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
On 2002-05-12 14:36, Amortcal wrote:
I'm using the following to enter values in cell B1 on sheet 2:

=(Sheet1!A1>Sheet1!A2)*100+(Sheet1!A1=Sheet1!A2)*50

The problem is, the formula is responding to empty cells. When both cells are empty, the formula is accepting that the cells are equaled and returning a value of one. This is messing up everything. I want the formula to ignore the cell if the cell is empty. What should I do?

Thanks.

=(Sheet1!A1>Sheet1!A2)*100+ISNUMBER(A1)*(Sheet1!A1=Sheet1!A2)*50

would return 0 in case A1 and/or A2 are empty.

Is that what you would want to have?

Aladin
 
Upvote 0
On 2002-05-12 14:55, Amortcal wrote:
Aladin thanks...
You really know your stuff...it works just the way I want it to.

Thanks again.

Just be sure that Sheet1!A1 will never contain a text representation of a numeric value!
 
Upvote 0
it works just the way I want it to.

Are you sure? I actually attempted to change my last reply into a question by editing it. It seems I didn't succeed. So I'm posing that question now:

What result do you want to see
when

A1 or A2 is blank

and when

both A1 and A2 are blank?
This message was edited by Aladin Akyurek on 2002-05-12 15:15
 
Upvote 0
It actually worked just the way I wanted it to.

When A1 is blank I want the result to be zero, and the same when A2 is blank. That is, once a cell is blank the result should be zero.

Thanks
 
Upvote 0
On 2002-05-12 15:29, Amortcal wrote:
It actually worked just the way I wanted it to.

When A1 is blank I want the result to be zero, and the same when A2 is blank. That is, once a cell is blank the result should be zero.

Thanks

May I suggest using

=(COUNT(Sheet1!A1:A2)=2)*((Sheet1!A1>Sheet1!A2)*100+(Sheet1!A1=Sheet1!A2)*50)

instead.

Aladin
 
Upvote 0

Forum statistics

Threads
1,213,504
Messages
6,114,020
Members
448,543
Latest member
MartinLarkin

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