• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Reverse arabic text

Hello everyone,
I have a file that has a problem, somehow it has reversed the arabic text in the file. for example
The correct text is:
تحليل انتاجية الفاكهة موسم 2020

the reversed text in the file
2020 مسوم ةهكافلا ةيجاتنا ليلحت

all characters are reversed. I was wondering if there is a way to automatically correct the order of the characters to be as the correct text (the first one).

Thank you.
 

Attachments

deciog

Active Member
Mamdouh Elfors

Not if I understand the problem, maybe this formula helps, for version 2019 or higher of Excel

=TEXTJOIN(,FALSE,MID(J3,LEN(J3)-ROW(INDIRECT("1:"&LEN(J3)))+1,1))

Decio
 
Last edited:
Thank you for your answer!

Unfortunately my version is 2016, I have tried this solution with it and as you mentioned, it only works with 2019 or higher. Is there a way to use a similar solution but for 2016?
 
Thanks for your reply

I have tried to following formula but it only produces one character (the last character, which is correct) and it doesn't produce the rest of the text.

CONCATENATE(MID(J3,LEN(J3)-ROW(INDIRECT("1:"&LEN(J3)))+1,1))

I'm not sure why its not working.
 

Attachments

Peter Bartholomew

Well-Known Member
@deciog's idea of CONCAT is the simplest idea but requires Office 2019. I have used it with the LET function in Excel 365 but that is of no use to the OP.
Code:
= LET(
  n, LEN(arabicText),
  k, SEQUENCE(n,1,n,-1),
  chr, MID(arabicText, k, 1),
  CONCAT(chr) )
@Mamdouh Elfors CONCATENATE doesn't work because it is, and always has been, a particularly useless function that serves no purpose other than reducing the need to type "&".

Something that is possible is to use Power Query. It has a Text.Reverse method.
72164
Code:
let
    Source = Excel.CurrentWorkbook(){[Name="arabicText"]}[Content],
    Reversed = Text.Reverse(Source{0}[Column1]),
    #"Converted to Table" = #table(1, {{Reversed}}),
    ReversedOutput = Table.RenameColumns(#"Converted to Table",{{"Column1", "Corrected"}})
in
    ReversedOutput
 

Attachments

Peter Bartholomew

Well-Known Member
@Mamdouh Elfors
Forgive me for asking but when I compare the text strings they are not visibly the same characters in reverse order. I tried inserting a space between each pair of characters and a few changed form quite radically. What is happening? Do letters change their form when used as the initial letter of a word or, perhaps, within paired combinations?
 
That is just how the characters in the arabic language work. Most characters will look different if it is linked to other characters. Also some characters can not be linked with characters after it, which in forces the first character after it to be unlinked form. It is kind of hard to explain.
 
Top