Using IF,AND + LEN

jarrodexcel

New Member
Joined
Dec 14, 2022
Messages
23
Office Version
  1. 365
Platform
  1. Windows
So i have a cell with product codes inside of that. for example
cell a1 contains data - 1x ddjed8cx7ee
cell a2 contains data - 4x ddjeudaadi3
cell a3 contains data - 1x nddnadjnfke 1x ajo37danunau 4x aud73ndnnak
and so on

I am trying to find a formula that can
A. return the value of 30 if cell contains the character (1x)
B. multiply this value of 30 by how many times there are... ie 2x will return 60. 5x returns 150 and so on
C. Due to the way the data is downloaded into my excel sheet, the data is put with lines if there is multiple data per cell. so in cell A if there is more than 1 set of product codes it will put them all in a drop down line like this
1x nubd77e87e
1x11683638731
2xeufw87h32h22
and so on.
so the total of this cell would have 4x in it and should return the value of 120

Any help what so ever would be so appreciated, i can provide more detail if required as im sure ive not explained this well enough, unless you're some excel wizard.
 

Attachments

  • Capture.PNG
    Capture.PNG
    13.4 KB · Views: 22

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Excel Formula:
=LET(a,TEXTSPLIT(A1," "),b,VALUE(LEFT(a,LEN(a)-1)),c,FILTER(b,ISNUMBER(b)),SUM(c)*20)
 
Upvote 0
Hi & welcome to MrExcel.
Another option
Fluff.xlsm
AB
1
21x nubd77e87e 1x 11683638731 2x eufw87h32h22120
Data
Cell Formulas
RangeFormula
B2B2=SUM(--TAKE(TEXTSPLIT(A2,"x ",CHAR(10)),,1))*30
 
Upvote 0
Hi & welcome to MrExcel.
Another option
Fluff.xlsm
AB
1
21x nubd77e87e 1x 11683638731 2x eufw87h32h22120
Data
Cell Formulas
RangeFormula
B2B2=SUM(--TAKE(TEXTSPLIT(A2,"x ",CHAR(10)),,1))*30
Perfect, this helped a bunch !! absolute wizard
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

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