If cell contain "xy" multiply by

carrriee90

New Member
Joined
Oct 23, 2012
Messages
2
Hello everyone, I really need help with a formula!

Invoiced byCompanyAmountLeadTo XYTo AB
XY600XY
AB2560AB
XY1000AB
AB1500XY

<tbody>
</tbody>

I need to create a formula whch says that
  • if money is invoiced by XY and is is the lead of XY the amount must be multiplied by 0.2 in column To AB
  • if money is invoiced by AB and is the lead of AB the amount must be multiplied by 0.2 in column TO XY
  • if money is invoiced by XY and the lead of AB the amount must be multiplied by 0.3 in column To AB
  • if money is invoiced by AB and the lead of XY the amount must be multiplied by 0.3 in column To XY

Is it possible to put this in one function?

Thanks in advance!!!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi,
let Your Data be in A1:F5, in Column E (with the Text To XY) I propose a Formula:
Code:
=IF((RIGHT($E$1,2)<>A2)*(RIGHT($E$1,2)<>D2),0,2*C2,IF((RIGHT($E$1,2)<>A2)*(RIGHT($E$1,2)=D2),0,3*C2,""))
Try to create a suitable Formula in Column F, this is Your HomeWork, best regards.
 
Upvote 0
Welcome to MrExcel.

Here is a single formula solution:

=IF(AND($A2="XY",RIGHT(E$1,2)="AB"),$C2*IF($D2="XY",0.2,0.3),IF(AND($A2="AB",RIGHT(E$1,2)="XY"),$C2*IF($D2="AB",0.2,0.3),""))
 
Upvote 0
Try this in E2, Drag Across to F2 then Down

Excel Workbook
ABCDEF
1Invoiced byCompanyAmountLeadTo XYTo AB
2XY600XY180
3AB2560AB512
4XY1000AB200
5AB1500XY450
Sheet1
 
Last edited:
Upvote 0
Thanks for the answers but I keep on getting a message that the formulas contain errors. No idea what i am doing wrong!
 
Upvote 0
What delimters does your system use?
Try changing the commas to semi-colons.
 
Upvote 0

Forum statistics

Threads
1,215,374
Messages
6,124,569
Members
449,173
Latest member
Kon123

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