Writing formula inside a IF condition in a macro


Help in building macro with to enter formula inside a IF condition.
Screenshot 2021-10-04 135034

Eg 1 - If A2=a and B2=x then D =C2*20 (it is a formula)

2 - If A3=a and B3=y then D =C3*15 (it is a formula)

Similarly for other combinations range should be in a loop.

Thanks in Advance.

=IF(AND(A2=“x”, B2=“y”),C2(multiplication sign)*10,C2(multiplication sign)*15)

Use multiple assign to assin fields and create IF/Else condition defining variables…

Thanks @rahulsharma
For more than 2 combinations what is the syntax .

That csn be altered easily.

Just add that using proper clauses.

Below link will help, and if not. send the conditions you jees to add we can helo but below link is easy to understand and use.


Thank you @rahulsharma


Find the below workflow for writting formula inside if condiditon in a macro.

IFCondition.xaml (4.4 KB)