Multiple IF(AND

MickyMouse123

New Member
Joined
Mar 31, 2023
Messages
5
Office Version
  1. 2013
Hi,
Am trying to use multiple cells to calculate a value in a cell. See the attachment =IF($C$3=$L$3,L7,L7*95%) this formula works just fine.
But when I put in the second part IF(AND(C3=L4,D3=M4),L7*90%) it gives an error.
Not sure if the IF(AND function is written correctly.

Here is a pseudo code for the same. Let me know if this helps.
Start At the beginning C3, D3, E3, F3, G3 and H3 will be "ALL"
Next Step - IF C3=N4, the value in F7 should be equal to I7 * 95%
Next Step - IF C3=N4 and D3=O4, the value in F7 should be equal to I7 * 90%
Next Step - IF C3=N4, D3=O4 and E3=P4, the value in F7 should be equal to I7 * 85%
Next Step - IF C3=N4, D3=O4, E3=P4 and F3=Q4, the value in F7 should be equal to I7 * 80%
Next Step - IF C3=N4, D3=O4, E3=P4, F3=Q4 and G3=R4, the value in F7 should be equal to I7 * 75%
Next Step - IF C3=N4, D3=O4, E3=P4, F3=Q4,G3=R4 and H3=S4, the value in F7 should be equal to I7 * 70%

Thanks
 

Attachments

  • IF(AND.....png
    IF(AND.....png
    67.9 KB · Views: 15

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
The and looks OK, what is the error that you get?
 
Upvote 0
The and looks OK, what is the error that you get?
I am able to write the following formula: =IF($C$3=$N$3,N7,IF(AND(C3=N4,D3=O4),N7*90%,N7*95%))
Am not able to build on this. That is I am not able to create multiple IF(AND statements. I do not know how to do so.
The ones in green below is what I have been able to do in the formula above. The rest in need help with.
Next Step - IF C3=N4, the value in F7 should be equal to I7 * 95%
Next Step - IF C3=N4 and D3=O4, the value in F7 should be equal to I7 * 90%

Next Step - IF C3=N4, D3=O4 and E3=P4, the value in F7 should be equal to I7 * 85%
Next Step - IF C3=N4, D3=O4, E3=P4 and F3=Q4, the value in F7 should be equal to I7 * 80%
Next Step - IF C3=N4, D3=O4, E3=P4, F3=Q4 and G3=R4, the value in F7 should be equal to I7 * 75%
Next Step - IF C3=N4, D3=O4, E3=P4, F3=Q4,G3=R4 and H3=S4, the value in F7 should be equal to I7 * 70%
 
Upvote 0
Try

Excel Formula:
=IF($C$3=$N$4,I7*0.95,IF(AND($C$3=$N$4,D3=O4),I7*0.9,IF(AND($C$3=N4,D3=O4,E3=P4),I7*0.85,IF(AND($C$3=$N$4,D3=O4,E3=P4,F3=Q4),I7*0.8,IF(AND($C$3=$N$4,D3=O4,E3=P4,F3=Q4,G3=R4),I7*0.75,I7*0.7)))))
 
Upvote 0
Try

Excel Formula:
=IF($C$3=$N$4,I7*0.95,IF(AND($C$3=$N$4,D3=O4),I7*0.9,IF(AND($C$3=N4,D3=O4,E3=P4),I7*0.85,IF(AND($C$3=$N$4,D3=O4,E3=P4,F3=Q4),I7*0.8,IF(AND($C$3=$N$4,D3=O4,E3=P4,F3=Q4,G3=R4),I7*0.75,I7*0.7)))))
Thank you for the input. There is one detail I did not give in the psudeo code. The first line reads like this.
At the beginning C3, D3, E3, F3, G3 and H3 will be "ALL". If TRUE F7=I7. I have added the condition in bold.
Am not sure where to put this (If TRUE F7=I7), at the beginning or at the end. But, because this condition is not put in there, I think what is happening is F7 is showing a value of 42%.
Also, I think there is one more condition that should be there. That is "If the value in C3 - "ALL", then keep the the value of F7=I7.
Am not sure if I was able to articulate this appropriately so that you can understand it.
Psudeo Code:
Start - At the beginning C3, D3, E3, F3, G3 and H3 will be "ALL". If TRUE F7=I7
Check - If C3="ALL", F7=I7
Next Step - IF C3=N4, the value in F7 should be equal to I7 * 95%
Next Step - IF C3=N4 and D3=O4, the value in F7 should be equal to I7 * 90%
Next Step - IF C3=N4, D3=O4 and E3=P4, the value in F7 should be equal to I7 * 85%
Next Step - IF C3=N4, D3=O4, E3=P4 and F3=Q4, the value in F7 should be equal to I7 * 80%
Next Step - IF C3=N4, D3=O4, E3=P4, F3=Q4 and G3=R4, the value in F7 should be equal to I7 * 75%
Next Step - IF C3=N4, D3=O4, E3=P4, F3=Q4,G3=R4 and H3=S4, the value in F7 should be equal to I7 * 70%
 
Upvote 0
So if any of cells C3, D3, E3, F3, G3 and H3 has a text "ALL" then you want to return the value of I7 right?
 
Upvote 0
Hi,
Am trying to use multiple cells to calculate a value in a cell. See the attachment =IF($C$3=$L$3,L7,L7*95%) this formula works just fine.
But when I put in the second part IF(AND(C3=L4,D3=M4),L7*90%) it gives an error.
Not sure if the IF(AND function is written correctly.

Here is a pseudo code for the same. Let me know if this helps.
Start At the beginning C3, D3, E3, F3, G3 and H3 will be "ALL"
Next Step - IF C3=N4, the value in F7 should be equal to I7 * 95%
Next Step - IF C3=N4 and D3=O4, the value in F7 should be equal to I7 * 90%
Next Step - IF C3=N4, D3=O4 and E3=P4, the value in F7 should be equal to I7 * 85%
Next Step - IF C3=N4, D3=O4, E3=P4 and F3=Q4, the value in F7 should be equal to I7 * 80%
Next Step - IF C3=N4, D3=O4, E3=P4, F3=Q4 and G3=R4, the value in F7 should be equal to I7 * 75%
Next Step - IF C3=N4, D3=O4, E3=P4, F3=Q4,G3=R4 and H3=S4, the value in F7 should be equal to I7 * 70%

Thanks
Not for nothing, but why is C3 and L3 absolute ($C$3 and $L$3) in the first formula, but naked (C3 and L4?) in the second?
Also, the IF has no "ELSE" which may have been mentioned before. The formula should be
Excel Formula:
IF( AND(C3=L4, D3=M4), L7*90%, "NOT EQUAL")
or something unless you're looking for it to return FALSE - the Binary value, not the text "FALSE".
 
Upvote 0
Not for nothing, but why is C3 and L3 absolute ($C$3 and $L$3) in the first formula, but naked (C3 and L4?) in the second?
Also, the IF has no "ELSE" which may have been mentioned before. The formula should be
Excel Formula:
IF( AND(C3=L4, D3=M4), L7*90%, "NOT EQUAL")
or something unless you're looking for it to return FALSE - the Binary value, not the text "FALSE".
Not for nothing, but why is C3 and L3 absolute ($C$3 and $L$3) in the first formula, but naked (C3 and L4?) in the second? - That's a typo. It should be $C$3 and $L$3
Or something unless you're looking for it to return FALSE - the Binary value, not the text "FALSE". - Am not looking for it to return "FALSE".
IF( AND(C3=L4, D3=M4), L7*90%, "NOT EQUAL") - Should this be at the very beginning of the formula you had provided earlier?
 
Upvote 0

Forum statistics

Threads
1,224,272
Messages
6,177,632
Members
452,786
Latest member
k3calloway

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