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

NNOG28

New Member
Joined
Feb 28, 2019
Messages
11
column/rowABCD
1ItemUnit or palletunit per caseTotal Case
2Apple50225 (=50/2)
3Apple on a pallet428 (=4*2)
4Orange842 (=8/4)
5Orange on a pallet15460 (=15*4)

<tbody>
</tbody>

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.
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
46,134
Office Version
  1. 365
Platform
  1. Windows
How about
=IF(ISNUMBER(SEARCH("pallet",A2)),B2*C2,B2/C2)
 

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
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
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,593
Office Version
  1. 2007
Platform
  1. Windows
Try:

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

NNOG28

New Member
Joined
Feb 28, 2019
Messages
11
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,108,708
Messages
5,524,428
Members
409,577
Latest member
Dwg

This Week's Hot Topics

Top