Jan 27 2023 05:42 AM
Hi I need help,
I need the emails of different people with the same domain to be assigned to 1 Agent. If there are more than 5 people ( I want the next 5 ) to be assigned to a different Agent.
Jan 27 2023 06:47 AM
=IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,3)="uvw")),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="uvw")),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="uvw")),5)+1)
You can try this formula if there is only one domain ("uvw" in the example) in your data.
Feb 01 2023 07:08 AM
Feb 01 2023 10:14 AM
=IF(RIGHT(C2,3)="csv",IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,3)="csv")),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="csv")),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="csv")),5)+1),IF(RIGHT(C2,3)="abc",IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,3)="abc")),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="abc")),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="abc")),5)+1),""))
You are welcome. I'd apply a nested IF formula for multiple domains.
Feb 07 2023 08:55 AM
Feb 07 2023 09:20 AM
=IF(RIGHT(C2,3)="csv",IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,3)="csv")),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="csv")),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="csv")),5)+1),IF(RIGHT(C2,3)="abc",IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,3)="abc")),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="abc")),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="abc")),5)+1),IF(RIGHT(C2,3)="usa",IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,3)="usa")),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="usa")),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="usa")),5)+1),IF(RIGHT(C2,3)="zzz",IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,3)="zzz")),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="zzz")),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="zzz")),5)+1),IF(RIGHT(C2,3)="edv",IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,3)="edv")),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="edv")),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="edv")),5)+1),"")))))
Both formulas work flawlessly and as expected in my sheet. I've expanded the nested IF formula for 5 domains and it returns the intended results. Below i've highlighted the initial criteria of each IF statement for explanation.
=IF(RIGHT(C2,3)="csv",IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,3)="csv")),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="csv")),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="csv")),5)+1),
IF(RIGHT(C2,3)="abc",IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,3)="abc")),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="abc")),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="abc")),5)+1),
IF(RIGHT(C2,3)="usa",IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,3)="usa")),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="usa")),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="usa")),5)+1),
IF(RIGHT(C2,3)="zzz",IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,3)="zzz")),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="zzz")),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="zzz")),5)+1),
IF(RIGHT(C2,3)="edv",IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,3)="edv")),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="edv")),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,3)="edv")),5)+1),"")))))
Feb 08 2023 07:32 AM
Feb 08 2023 07:53 AM
You are welcome. This formula returns the intended result in my sheet.
=IF(RIGHT(C2,5)="e.com",IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,5)="e.com")),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,5)="e.com")),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,5)="e.com")),5)+1),
IF(RIGHT(C2,8)="test.com",IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,8)="test.com")),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,8)="test.com")),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,8)="test.com")),5)+1),
IF(RIGHT(C2,9)="email.com",IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,9)="email.com")),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,9)="email.com")),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,9)="email.com")),5)+1),"")))
Feb 08 2023 10:20 AM
Feb 08 2023 10:42 AM
With this formula it's possible to enter variable domains in cells G2, G3 and G4. In H2 is the formula =LEN(G2) which is copied down.
=IF(RIGHT(C2,$H$2)=$G$2,IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,$H$2)=$G$2)),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$2)=$G$2)),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$2)=$G$2)),5)+1),
IF(RIGHT(C2,$H$3)=$G$3,IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,$H$3)=$G$3)),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$3)=$G$3)),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$3)=$G$3)),5)+1),
IF(RIGHT(C2,$H$4)=$G$4,IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,$H$4)=$G$4)),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$4)=$G$4)),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$4)=$G$4)),5)+1),"")))
Feb 09 2023 11:09 AM
Feb 09 2023 11:53 AM
Yes, here it is. I've updated the formula in case there are domains such as "teste.com" and "e.com". In these domains the last 5 digits are identical ( e.com ) and this is considered by the new updated formula.
Feb 10 2023 09:42 AM
Feb 12 2023 04:17 AM
You are welcome. I'm not sure what you exactly want to do with specific data e.g. TL6, TL7 from a cell. Perhaps you can start a new discussion and give an example of your data and the expected result both without sensitive information.
Feb 13 2023 12:23 PM
Feb 14 2023 03:28 AM
I don't know if there is a formula for an unlimited number of domains. With a nested IF you can reference 64 domains and if you work with Excel 2019 or later you can apply a nested IFS which can reference up to 127 domains.
Feb 14 2023 05:53 AM
Feb 14 2023 07:45 AM
If there are actually e.g. 100 domains in your sheet i'd count 10 domains at a time and save the results after each step.
In order to expand the formula you can copy the highlighted part of the formula:
=IF(RIGHT(C2,LEN(C2)-FIND("@",C2))=$G$2,IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,$H$2)=$G$2)),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$2)=$G$2)),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$2)=$G$2)),5)+1),
IF(RIGHT(C2,LEN(C2)-FIND("@",C2))=$G$3,IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,$H$3)=$G$3)),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$3)=$G$3)),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$3)=$G$3)),5)+1),
IF(RIGHT(C2,LEN(C2)-FIND("@",C2))=$G$4,IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,$H$4)=$G$4)),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$4)=$G$4)),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$4)=$G$4)),5)+1),"")))
Then paste the copied part of the formula into the last part of the formula which is highlighted in green:
=IF(RIGHT(C2,LEN(C2)-FIND("@",C2))=$G$2,IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,$H$2)=$G$2)),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$2)=$G$2)),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$2)=$G$2)),5)+1),
IF(RIGHT(C2,LEN(C2)-FIND("@",C2))=$G$3,IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,$H$3)=$G$3)),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$3)=$G$3)),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$3)=$G$3)),5)+1),
IF(RIGHT(C2,LEN(C2)-FIND("@",C2))=$G$4,IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,$H$4)=$G$4)),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$4)=$G$4)),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$4)=$G$4)),5)+1),"")))
In the last step replace $H$4 and $G$4 with $H$5 and $G$5 within the recently pasted part of the formula.
=IF(RIGHT(C2,LEN(C2)-FIND("@",C2))=$G$2,IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,$H$2)=$G$2)),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$2)=$G$2)),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$2)=$G$2)),5)+1),
IF(RIGHT(C2,LEN(C2)-FIND("@",C2))=$G$3,IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,$H$3)=$G$3)),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$3)=$G$3)),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$3)=$G$3)),5)+1),
IF(RIGHT(C2,LEN(C2)-FIND("@",C2))=$G$4,IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,$H$4)=$G$4)),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$4)=$G$4)),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$4)=$G$4)),5)+1),
IF(RIGHT(C2,LEN(C2)-FIND("@",C2))=$G$4,IF(MOD(SUMPRODUCT(N(RIGHT($C$2:C2,$H$4)=$G$4)),5)=0,"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$4)=$G$4)),5),"Agent ""IENT(SUMPRODUCT(N(RIGHT($C$2:C2,$H$4)=$G$4)),5)+1),""))))
This can be repeated for up to 64 nestings with the IF formula.
Feb 17 2023 08:48 AM