IF THEN Formula required

paul w

Board Regular
Joined
Apr 25, 2010
Messages
195
help needed formula in D1

only if there is any data in A1 and C1 is >40 then (C1-40)*0.37
only if there is any data in B1 and C1 is >40 then (C1-40)*0.27

only need it to calculate if C1 is greater than 40
if there is nothing in C1 dont run the formula
A1 or B1 will never both be populated at the same time
thanks in anticipation
paul
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
just in case A1 or B1 are both empty

<TABLE style="FONT-FAMILY: Arial; FONT-SIZE: 9pt" border=1 cellSpacing=0 cellPadding=2><TBODY><TR><TD>=MAX((C1-40)*IF(A1,0.37,0.27),0)</TD></TR></TBODY></TABLE>=IF(AND(A1<>"",C1>40),(C1-40)*0.37,IF(AND(B1<>"",C1>40),(C1-40)*0.37,""))
<TABLE style="FONT-FAMILY: Arial; FONT-SIZE: 9pt" border=1 cellSpacing=0 cellPadding=2><TBODY><TR><TD>=MAX((C1-40)*IF(A1,0.37,0.27),0)</TD></TR></TBODY></TABLE>
 
Upvote 0
thanks to both of you the formula incase a1 and b1 are both empty is just saying false, any ideas, this is what im using to suit the cells on my sheet.

=MAX((L6-40)*IF(J6,0.37,0.27),0)=IF(AND(J6<>"",L6>40),(L6-40)*0.37,IF(AND(K6<>"",L6>40),(L6-40)*0.37,""))=MAX((L6-40)*IF(J6,0.37,0.27),0)
 
Upvote 0
=IF(AND(A1<>"",C1>40),(C1-40)*0.37,IF(AND(B1<>"",C1>40),(C1-40)*0.37,""))

returns a blank cell if A1 and B1 are empty otherwise it will calculate if C1 is greater than 40

I'm not sure how the other 2 formulas got in my last answer
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,850
Members
452,948
Latest member
UsmanAli786

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