If cell has pack or pk return Pack of 100 or pk100

Jaffabfc

Board Regular
Joined
Jul 5, 2013
Messages
230
Office Version
  1. 365
Platform
  1. Windows
Hi,

I am wanting a formula for this spreadsheet.

Column A has a list of descriptions for example "red pens pack of 100" or "red pens pk25"

What i am wanting is in column B to pick up Pack of 100 or pk25 (numbers would change).

Ive got partly there with this:

=IF(OR(ISNUMBER(SEARCH({"pack","pk"},A2))),"pack","pk")

but cant get any further
 

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.
I also would need a formula for in column c to say that is the cell a2 includes a colour put the colour in cell c2, then cell c3 for a3 etc.

so the colours would be every colour pink/red/green/black/violet etc
 
Upvote 0
It isn't clear from your question what you want the content of column B to actually be, your formula returns "pk" on a blank cell, and "pack" on cells that contain either "pack" or "pk".
I'm guessing from your second question you want to extract the colour value from cell A2, how are you defining 'every colour' is there a separate listing of the colours used.
Ultimately do you want the number in each pack by colour, but what use is that on a row by itself. Any reason you can't use the auto filter?

Happy to give this a go with a bit more direction...

bob
 
Upvote 0
Hi Sorry never been good at explaining.

basically:

A2= RED PENS PACK OF 100
A3= PK10 GREEN BALLS

B2= PACK OF 100 (if formula was successful)
B3= PK10 (if formula was successful)

C2= RED (if formula was successful)
C3= GREEN (if formula was successful)

there is no list of colours because the list would be huge, although i could just get a huge list off the internet and stick into a seperate sheet to link to, if this helps.

thanks
 
Last edited:
Upvote 0
Ive done a work around for the colour, but its not ideal.

I have put in J1:X1 some colours then in J2:X61401 a formula of "=IFERROR(IF(SEARCH(H$1,$a2,1),H$1),"")" then concartenated in another cell to put all colours toghether.

The pack side i am finding an issue as i can get it to say if there is a pack but cant get the numbers after.
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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