If cell contains text then calculate - What is the formula?

NNOG28

New Member
Joined
Feb 28, 2019
Messages
11
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]column/row[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Item[/TD]
[TD]Unit or pallet[/TD]
[TD]unit per case[/TD]
[TD]Total Case[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Apple[/TD]
[TD]50[/TD]
[TD]2[/TD]
[TD]25 (=50/2)[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Apple on a pallet[/TD]
[TD]4[/TD]
[TD]2[/TD]
[TD]8 (=4*2)[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Orange[/TD]
[TD]8[/TD]
[TD]4[/TD]
[TD]2 (=8/4)[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Orange on a pallet[/TD]
[TD]15[/TD]
[TD]4[/TD]
[TD]60 (=15*4)[/TD]
[/TR]
</tbody>[/TABLE]

I want to use if formula to calculate for column D. what should the formula be?

I tried this but it didn't work.

=IF(A2="*"&"pallet"&"*",B2*C2,B2/C2)

Please help.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
How about
=IF(ISNUMBER(SEARCH("pallet",A2)),B2*C2,B2/C2)
 
Upvote 0
Hello,

When it comes to designing your worksheet ...

You should make your life easier ...and have nothing but Apples and Oranges in your Items Column ...

and insert a Type Column ... with say P for Pallet and nothing for Unit ...

HTH
 
Upvote 0
Try:

=IFERROR(VLOOKUP("*pallet*",A2:B2,2,0)*C2,B2/C2)
 
Upvote 0
Hello,

When it comes to designing your worksheet ...

You should make your life easier ...and have nothing but Apples and Oranges in your Items Column ...

and insert a Type Column ... with say P for Pallet and nothing for Unit ...

HTH

This is a good idea to try to make it simpler when it comes to our own spreadsheet! however, it is a task that happen repetitively every week, so I want to try to have it formulated for saving time.

thank you.
 
Upvote 0

Forum statistics

Threads
1,223,711
Messages
6,174,029
Members
452,542
Latest member
Bricklin

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