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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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,223,908
Messages
6,175,304
Members
452,633
Latest member
DougMo

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