# IF formula and rounding

#### rhino80

##### New Member
HI All,

hoping for some quick help. Most probably a quick easy fix, but cant think what other way to work it. I am trying to use the below formula, but it isn't correct and I am not sure how to fix it.

=IF(Original!P2=400 or 250,0),round(Data!Q2/Data!P2*100,2)

Basically if the data in the original sheet is 400 or 250, then zi want it to be 40, if not then I want the calculation to be used.

### Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

#### Peter_SSs

##### MrExcel MVP, Moderator
Welcome to the MrExcel board!

Try
=IF(OR(Original!P2={400,250}),40,ROUND(Data!Q2/Data!P2*100,2))

Note that this will produce an error if Data!P2 is empty or zero.

Last edited:

#### rhino80

##### New Member
Thanks Peter. tried that formula but didn't seem to workand just did the calculation after data bit.

#### Peter_SSs

##### MrExcel MVP, Moderator
Thanks Peter. tried that formula but didn't seem to work ..
In what way did it not work? Error message, wrong answer? Something else?

did the calculation after data bit.
What does 'calculation after data bit' mean?

What are the values in these cells
Original!P2
Data!P2
Data!Q2

What result did my formula give?
What result should it give?

Your original post was a bit confusing
=IF(Original!P2=400 or 250,0),round(Data!Q2/Data!P2*100,2)

Basically if the data in the original sheet is 400 or 250, then zi want it to be 40, if not then I want the calculation to be used.

Last edited: