Hi there!
little background:
I have two sheets: "Sheet1" and "Keywords", the "Keywords" sheet has two keywords columns ( H & G ) and a category column ( D ), and "Sheet1" has a description column (Column E).
Requirement:
The description cell should contain keywords from both keyword columns ( at least one from H and one from G), if it does, then the formula should return the category ( D ), if it doesn't however, then it should check it against the next row in the keywords column and so on.
What I have done:
```
```
The problem with this code:
this code works perfectly, but the issue is that excel limits me to ~8000 characters, so I can't go through the whole keywords columns.
Is there more efficient way of doing this? a simple FOR loop would suffice but excel doesn't support them afaik.
Your help is much appreciated!
little background:
I have two sheets: "Sheet1" and "Keywords", the "Keywords" sheet has two keywords columns ( H & G ) and a category column ( D ), and "Sheet1" has a description column (Column E).
Requirement:
The description cell should contain keywords from both keyword columns ( at least one from H and one from G), if it does, then the formula should return the category ( D ), if it doesn't however, then it should check it against the next row in the keywords column and so on.
What I have done:
```
Excel Formula:
=IF(
C2="Incident",
IFS(
AND(OR(COUNTIF(E2, "*" & TEXTSPLIT(Keywords!$G$213,,"،") & "*"),COUNTIF(G2, "*" & TEXTSPLIT(Keywords!$G$213,,"،") & "*")), OR(
COUNTIF(E2, "*" & TEXTSPLIT(Keywords!$H$213,, "،") & "*"),COUNTIF(G2, "*" & TEXTSPLIT(Keywords!$H$213,, "،") & "*"))),
Keywords!$D$213,
AND(OR(COUNTIF(E2, "*" & TEXTSPLIT(Keywords!$G$214,,"،") & "*"),COUNTIF(G2, "*" & TEXTSPLIT(Keywords!$G$214,,"،") & "*")), OR(
COUNTIF(E2, "*" & TEXTSPLIT(Keywords!$H$214,, "،") & "*"),COUNTIF(G2, "*" & TEXTSPLIT(Keywords!$H$214,, "،") & "*"))),
Keywords!$D$214,
.....
.....
.....
AND(OR(COUNTIF(E2, "*" & TEXTSPLIT(Keywords!$G$300,,"،") & "*"),COUNTIF(G2, "*" & TEXTSPLIT(Keywords!$G$300,,"،") & "*")), OR(
COUNTIF(E2, "*" & TEXTSPLIT(Keywords!$H$300,, "،") & "*"),COUNTIF(G2, "*" & TEXTSPLIT(Keywords!$H$300,, "،") & "*"))),
Keywords!$D$300
),
"not incident"
)
```
The problem with this code:
this code works perfectly, but the issue is that excel limits me to ~8000 characters, so I can't go through the whole keywords columns.
Is there more efficient way of doing this? a simple FOR loop would suffice but excel doesn't support them afaik.
Your help is much appreciated!