Calculate a formula, If Then statement, based off of matching text.

Cam4P911

New Member
Joined
Dec 8, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I am trying to do an if/then statement that will take text in column B and calculate the formula in column C to give me an amount then to leave it blank if there isn’t a match.

Column D’s operation would be the same with different search word.

In other words, I would like to have all of column B calculate the PreCan orders.
Column D would calculate the 1st Class orders.



A
B
C
D
1​
QuantityPostage type
PreCan STD
1st Class
2​
468​
PreCan STD=A2*.0349
3​
1​
1st Class=A3*.60


I’ve tried

=if(search("PreCan",B2)),"(=(C2*.0349)","")

=if("PreCan",B2)),"(C2*.0349)","")
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
test.xlsm
ABCD
1QuantityPostage typePreCan STD 1st Class
2462PreCan STD16.1238 
311st Class 0.6
Sheet3
Cell Formulas
RangeFormula
C2:C3C2=IF(COUNTIF(B2,"PreCan*"),A2*0.0349,"")
D2:D3D2=IF(COUNTIF(B2,"1st*"),A2*0.6,"")
 
Upvote 0
Thank you so much - works great. Saved me hours of trying to figure it out and find an answer.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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