FORMULA FOR CATEGORIES

punit83

Board Regular
Joined
Jan 17, 2018
Messages
79
Office Version
  1. 2019
Platform
  1. Windows
NEED FORMULA TO CATEGORIES FROM DATA.

IN COLUMN A DATA ARE THERE WITH THIS DETAIL IN IT AND I WANT TO CATEGORIES IN COLUMN B.
PLS HELP WITH FORMULA I TRIED WITH IFS, SEARCH BUT GETTING ERROR.

Book1
AB
1INV AB 001-24-25INV
2PAYMENT RECEIVEDPAYMENT
3RECEIVED MATERIALMATERIAL
4PART PAYMENTPART
Sheet1


THANKS IN ADVANCE.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Well,

I'm not sure if I understood what you were asking, but I think that this is it:

=IF(LEFT(A1;3)="INV";"INV";IF(A1="PAYMENT RECEIVED";"PAYMENT";IF(A1="RECEIVED MATERIAL";"MATERIAL";IF(A1="PART PAYMENT";"PART"))))

Maybe some excel guru knows a better way, this is my way...
 
Upvote 0
How about:
=XLOOKUP(LEFT(A1,3),{"INV","PAY","REC","PAR"},{"INV","PAYMENT","MATERIAL","PART"},"")
 
Upvote 0
Well,

I'm not sure if I understood what you were asking, but I think that this is it:

=IF(LEFT(A1;3)="INV";"INV";IF(A1="PAYMENT RECEIVED";"PAYMENT";IF(A1="RECEIVED MATERIAL";"MATERIAL";IF(A1="PART PAYMENT";"PART"))))

Maybe some excel guru knows a better way, this is my way...

Hello Thanks for reply with formula.... but will not work for me
Please refer below table maybe i couldn't explain properly in above query.

Sorry for above improper data
 
Upvote 0
How about:
=XLOOKUP(LEFT(A1,3),{"INV","PAY","REC","PAR"},{"INV","PAYMENT","MATERIAL","PART"},"")
Thank you for reply.
maybe i couldn't explain properly in above query, please refer to below table as i need formula for below table to extract data and create categories,
Sorry for above improper data

Please refer to below table

Book1.xlsx
AB
1INV AB 001-24-25 Dated :XX-XX-XXXXINV
2PAYMENT RECEIVED FOR INV # ABPAYMENT
3RECEIVED MATERIAL FOR PROJECT XMATERIAL
4PART PAYMENTPART
Sheet1
 
Upvote 0
I don't think your criteria are clear. What do expect to return for
"PARTIAL PAYMENT FOR MATERIAL INV XYZ" ?
"INV PAYMENT FOR XYZ"?
 
Upvote 0
I don't think your criteria are clear. What do expect to return for "PARTIAL PAYMENT FOR MATERIAL XYZ" ?
if column A data has INV word in it "INV AB 001-24-25 Dated :XX-XX-XXXX" than i want to categorized as "INV" in column B
if column A data has PAYMNET word in it "PAYMENT RECEIVED FOR INV # AB" than i want to categorized as "PAYMENT" in column B
if column A data has MATERIAL word in it "RECEIVED MATERIAL FOR PROJECT X" than i want to categorized as "MATERIAL" in column B
if column A data has PART word in it "RECEIVED PART PAYMENT FOR INV # 123" than i want to categorized as "PART" in column B


Thanx in Advance :)
 
Upvote 0
The point of my prior post was multiple keywords can appear within the same string. Do you want to categorize whichever appear first?
 
Upvote 0
if column A data has INV word in it "INV AB 001-24-25 Dated :XX-XX-XXXX" than i want to categorized as "INV" in column B
if column A data has PAYMNET word in it "PAYMENT RECEIVED FOR INV # AB" than i want to categorized as "PAYMENT" in column B
if column A data has MATERIAL word in it "RECEIVED MATERIAL FOR PROJECT X" than i want to categorized as "MATERIAL" in column B
if column A data has PART word in it "RECEIVED PART PAYMENT FOR INV # 123" than i want to categorized as "PART" in column B


Thanx in Advance :)
.....YES
 
Upvote 0
Try:
Book1
ABCD
1INV AB 001-24-25 Dated :XX-XX-XXXXINVINV
2PAYMENT RECEIVED FOR INV # ABPAYMENTPAYMENT
3RECEIVED MATERIAL FOR PROJECT XMATERIALMATERIAL
4PART PAYMENTPARTPART
Sheet2
Cell Formulas
RangeFormula
B1:B4B1=LET(s,SEARCH($D$1:$D$4,A1),XLOOKUP(MIN(IF(ISNUMBER(s),s)),s,$D$1:$D$4))
 
Upvote 0
Solution

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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