If statement

patni

Board Regular
Joined
Jul 22, 2018
Messages
58
Hey guys I am stuck with a simple problem.
Can anyone please help me out

Basically I am doing sum of Q11:Q31

I need it to sum and show the result but with few IF conditions

cell C3 needs to have some data in it
cell Q2 needs to have some data in it
O33 needs to be equal to P33, V33 and W33

If it does not meet conditions then it would show ERROR
I have this formulae which works perfectly if P33=O33.
However I am not able to do P33=O33=V33=W33


Code:
=IF(AND(C3<>"",Q2<>"",P33=O33),SUM(Q11:Q31),"ERROR")

Can anyone please help me
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Re: help with If statement

Hi,

What does this mean:

"O33 needs to be equal to P33, V33 and W33"

Is it that O33 must equal the sum of P33 + V33 + W33? Or O33 = P33 and O33 = V33 and O33 = W33?

Matty
 
Upvote 0
Re: help with If statement

hey Matty,
Thanks for your reply.
the value in O33 needs to be equal to the value in P33, V33,W33

So if O33=1
P33=1
V33=1
W33=1

then i want it to sum
However if the values does not match of all the 4 cell den it would show error

Basically all the 4 cells must have the same value
 
Last edited:
Upvote 0
Re: help with If statement

Hi,

If O33, P33, V33 and W33 are all numeric, try:

Code:
=IF(AND(C3<>"",Q2<>"",STDEV(O33,P33,V33,W33)=0),SUM(Q11:Q31),"ERROR")

Else:

Code:
=IF(AND(C3<>"",Q2<>"",O33=P33,O33=V33,O33=W33),SUM(Q11:Q31),"ERROR")

Matty
 
Upvote 0
Re: help with If statement

Hey Matty,

the above code works perfectly.
Thank you so much for your help.
Thank you
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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