Formula? Do calculation or give error message if wrong data entered?

tbarrows112

New Member
Joined
Apr 12, 2018
Messages
1
Hello,

I have a (hopefully) somewhat simple question however I am struggling to know how to write the formula for this in Excel as I can only really do the basics.

Essentially, I have an 'X' cell, and a 'Y' cell. In cell 'Z' I want it to calculate the percentage difference of X to Y. Both cells X and Y will be updated by the user and presented with the answer in cell Z. However, if the user enters anything other than a number in cell 'X' I'd like the Z cell to say "please check cell x", and the same rule applying to cell y but saying "please check cell y".

Is this possible? And can anybody please advise me how to do this by helping with me with the formula I have to input:)?

Thank you in advance!!

Best Regards,
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi,

What if both X and Y are not numbers, scenario included in formula:


Excel 2010
XYZAA
1Column formatted as Percentage
21010010.00%10.00%
3this100Please check Cell XPlease check Cell X
410thatPlease check Cell YPlease check Cell Y
5thisthatPlease check Cells X and YPlease check Cells X and Y
Sheet3
Cell Formulas
RangeFormula
Z2=IF(COUNT(X2:Y2)=0,"Please check Cells X and Y",IF(NOT(ISNUMBER(X2)),"Please check Cell X",IF(NOT(ISNUMBER(Y2)),"Please check Cell Y",X2/Y2)))
AA2=IF(COUNT(X2:Y2)=2,X2/Y2,"Please check "&IF(COUNT(X2:Y2)=0,"Cells X and Y",IF(NOT(ISNUMBER(X2)),"Cell X","Cell Y")))


Edit: Shorter formula in AA2
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,362
Messages
6,171,639
Members
452,412
Latest member
MitchAgain

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