IF formula and rounding

rhino80

New Member
Joined
Oct 2, 2019
Messages
2
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.
 

Some videos you may like

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
Joined
May 28, 2005
Messages
44,771
Office Version
365
Platform
Windows
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
Joined
Oct 2, 2019
Messages
2
Thanks Peter. tried that formula but didn't seem to workand just did the calculation after data bit.
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
44,771
Office Version
365
Platform
Windows
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:

Watch MrExcel Video

Forum statistics

Threads
1,100,058
Messages
5,472,212
Members
406,809
Latest member
haf19

This Week's Hot Topics

Top