ไปยังเนื้อหาหลัก

วิธีแปลงสูตรเป็นสตริงข้อความใน Excel

โดยปกติ Microsoft Excel จะแสดงผลลัพธ์จากการคำนวณเมื่อคุณป้อนสูตรในเซลล์ อย่างไรก็ตามบางครั้งคุณอาจต้องแสดงเฉพาะสูตรในเซลล์เช่น = CONCATENATE ("000", "- 2")คุณจะจัดการกับมันอย่างไร? มีหลายวิธีในการแก้ปัญหานี้:

แปลงสูตรเป็นสตริงข้อความด้วยคุณสมบัติค้นหาและแทนที่

แปลงสูตรเป็นสตริงข้อความด้วย User Defined Function

แปลงสูตรเป็นสตริงข้อความหรือในทางกลับกันด้วยการคลิกเพียงครั้งเดียว


สมมติว่าคุณมีช่วงของสูตรในคอลัมน์ C และคุณต้องแสดงคอลัมน์ที่มีสูตรดั้งเดิม แต่ไม่ใช่ผลลัพธ์จากการคำนวณดังภาพหน้าจอต่อไปนี้:

doc แปลงสูตรข้อความ 1-1 2 doc แปลงสูตรข้อความ 2-2

ในการแก้ปัญหานี้ไฟล์ ค้นหาและแทนที่ คุณสมบัติอาจช่วยคุณได้โปรดทำดังนี้:

1. เลือกเซลล์ผลลัพธ์จากการคำนวณที่คุณต้องการแปลงเป็นสตริงข้อความ

2. จากนั้นกด Ctrl + H คีย์ร่วมกันเพื่อเปิดไฟล์ ค้นหาและแทนที่ กล่องโต้ตอบในกล่องโต้ตอบภายใต้ แทนที่ แท็บป้อนเท่ากับ = ลงชื่อเข้าใช้ สิ่งที่ค้นหา กล่องข้อความและป้อน '= เข้าไปใน แทนที่ด้วย กล่องข้อความดูภาพหน้าจอ:

doc แปลงสูตรข้อความ 3-3

3. จากนั้นคลิก แทนที่ทั้งหมด คุณสามารถดูผลลัพธ์ที่คำนวณทั้งหมดจะถูกแทนที่ด้วยสตริงข้อความสูตรดั้งเดิมดูภาพหน้าจอ:

doc แปลงสูตรข้อความ 4-4


รหัส VBA ต่อไปนี้ยังช่วยให้คุณจัดการกับมันได้อย่างง่ายดาย

1. กด อื่น ๆ + F11 ใน Excel และจะเปิดไฟล์ หน้าต่าง Microsoft Visual Basic for Applications.

2. คลิก สิ่งที่ใส่เข้าไป > โมดูลและวางมาโครต่อไปนี้ในไฟล์ หน้าต่างโมดูล.

Function ShowF(Rng As Range)
ShowF = Rng.Formula
End Function

3. ในเซลล์ว่างเช่นเซลล์ D2 ให้ป้อนสูตร = ShowF (C2).

doc แปลงสูตรข้อความ 5-5

4. จากนั้นคลิกเซลล์ D2 แล้วลาก Fill Handle ในช่วงที่คุณต้องการ

doc แปลงสูตรข้อความ 6-6


ถ้าคุณมี Kutools สำหรับ Excelเดียวกันกับที่ แปลงสูตรเป็นข้อความ คุณสามารถเปลี่ยนหลายสูตรเป็นสตริงข้อความได้ด้วยคลิกเดียว

Kutools สำหรับ Excel : ด้วย Add-in ของ Excel ที่มีประโยชน์มากกว่า 300 รายการทดลองใช้ฟรีโดยไม่มีข้อ จำกัด ใน 30 วัน. 

หลังจากการติดตั้ง Kutools สำหรับ Excelโปรดทำตามนี้:

1. เลือกสูตรที่คุณต้องการแปลง

2. คลิก Kutools > คอนเทนต์ > แปลงสูตรเป็นข้อความและสูตรที่คุณเลือกได้ถูกแปลงเป็นสตริงข้อความพร้อมกันดูภาพหน้าจอ:

เคล็ดลับ: หากคุณต้องการแปลงสตริงข้อความสูตรกลับไปเป็นผลลัพธ์จากการคำนวณโปรดใช้ยูทิลิตี้แปลงข้อความเป็นสูตรตามภาพหน้าจอต่อไปนี้:

หากคุณต้องการทราบข้อมูลเพิ่มเติมเกี่ยวกับคุณลักษณะนี้โปรดไปที่ แปลงสูตรเป็นข้อความ.

ดาวน์โหลดและทดลองใช้ Kutools for Excel ฟรีทันที!


Kutools สำหรับ Excel: ด้วย Add-in ของ Excel ที่มีประโยชน์มากกว่า 300 รายการให้ทดลองใช้ฟรีโดยไม่มีข้อ จำกัด ใน 30 วัน ดาวน์โหลดและทดลองใช้ฟรีทันที!

สุดยอดเครื่องมือเพิ่มผลผลิตในสำนักงาน

🤖 Kutools AI ผู้ช่วย: ปฏิวัติการวิเคราะห์ข้อมูลโดยยึดตาม: การดำเนินการที่ชาญฉลาด   |  สร้างรหัส  |  สร้างสูตรที่กำหนดเอง  |  วิเคราะห์ข้อมูลและสร้างแผนภูมิ  |  เรียกใช้ฟังก์ชัน Kutools...
คุณสมบัติยอดนิยม: ค้นหา เน้น หรือระบุรายการที่ซ้ำกัน   |  ลบแถวว่าง   |  รวมคอลัมน์หรือเซลล์โดยไม่สูญเสียข้อมูล   |   รอบโดยไม่มีสูตร ...
การค้นหาขั้นสูง: VLookup หลายเกณฑ์    VLookup หลายค่า  |   VLookup ข้ามหลายแผ่น   |   การค้นหาที่ไม่ชัดเจน ....
รายการแบบเลื่อนลงขั้นสูง: สร้างรายการแบบหล่นลงอย่างรวดเร็ว   |  รายการแบบหล่นลงขึ้นอยู่กับ   |  เลือกหลายรายการแบบหล่นลง ....
ผู้จัดการคอลัมน์: เพิ่มจำนวนคอลัมน์เฉพาะ  |  ย้ายคอลัมน์  |  สลับสถานะการมองเห็นของคอลัมน์ที่ซ่อนอยู่  |  เปรียบเทียบช่วงและคอลัมน์ ...
คุณสมบัติเด่น: กริดโฟกัส   |  มุมมองการออกแบบ   |   บาร์สูตรใหญ่    สมุดงานและตัวจัดการชีต   |  ห้องสมุดทรัพยากร (ข้อความอัตโนมัติ)   |  เลือกวันที่   |  รวมแผ่นงาน   |  เข้ารหัส/ถอดรหัสเซลล์    ส่งอีเมลตามรายการ   |  ซุปเปอร์ฟิลเตอร์   |   ตัวกรองพิเศษ (กรองตัวหนา/ตัวเอียง/ขีดทับ...) ...
ชุดเครื่องมือ 15 อันดับแรก12 ข้อความ เครื่องมือ (เพิ่มข้อความ, ลบอักขระ, ... )   |   50 + แผนภูมิ ประเภท (แผนภูมิ Gantt, ... )   |   40+ ใช้งานได้จริง สูตร (คำนวณอายุตามวันเกิด, ... )   |   19 การแทรก เครื่องมือ (ใส่ QR Code, แทรกรูปภาพจากเส้นทาง, ... )   |   12 การแปลง เครื่องมือ (ตัวเลขเป็นคำ, การแปลงสกุลเงิน, ... )   |   7 ผสานและแยก เครื่องมือ (แถวรวมขั้นสูง, แยกเซลล์, ... )   |   ... และอื่น ๆ

เพิ่มพูนทักษะ Excel ของคุณด้วย Kutools สำหรับ Excel และสัมผัสประสิทธิภาพอย่างที่ไม่เคยมีมาก่อน Kutools สำหรับ Excel เสนอคุณสมบัติขั้นสูงมากกว่า 300 รายการเพื่อเพิ่มประสิทธิภาพและประหยัดเวลา  คลิกที่นี่เพื่อรับคุณสมบัติที่คุณต้องการมากที่สุด...

รายละเอียด


แท็บ Office นำอินเทอร์เฟซแบบแท็บมาที่ Office และทำให้งานของคุณง่ายขึ้นมาก

  • เปิดใช้งานการแก้ไขและอ่านแบบแท็บใน Word, Excel, PowerPoint, ผู้จัดพิมพ์, Access, Visio และโครงการ
  • เปิดและสร้างเอกสารหลายรายการในแท็บใหม่ของหน้าต่างเดียวกันแทนที่จะเป็นในหน้าต่างใหม่
  • เพิ่มประสิทธิภาพการทำงานของคุณ 50% และลดการคลิกเมาส์หลายร้อยครั้งให้คุณทุกวัน!
Comments (20)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
How do I convert the non matched value retrieved from vlookup into text??
This comment was minimized by the moderator on the site
The find and replace facility is extremely useful, I didn't expect it to work when showing formulae instead of result. Thanks
This comment was minimized by the moderator on the site
[quote name="Jennifer"]Hi, is there a short cut method to concatenate 230 cells in excel to and text string, or do I have to add each cell to the concatenate formula with at divider? Thanks so much! Converting the range of data into Table (Insert>Table) may help you. As and when a row of data is appended to and inserted in to an existing table, formulas and format of number in columns are applied to the new data also. File size may increase in Table mode. The Table may be changed to Range mode later (Table tools>Tools>convert to range to reduce file size if needed. Maintaining data in Table mode has advantages.
This comment was minimized by the moderator on the site
The Visual Basic editor option didn't work for me - kept returning errors about it needing to be the first row?
This comment was minimized by the moderator on the site
Hi, is there a short cut method to concatenate 230 cells in excel to and text string, or do I have to add each cell to the concatenate formula with at divider? Thanks so much!
This comment was minimized by the moderator on the site
Inserting the “concatenation operator” (& or &” “&) among 230 Excel cells can be done in MS Word. This method is good enough if the task is not repetitive and if a Procedure is not available. (1) Arrange all the 230 cell-references (the text of which is to be merged in to one cell) in single column or single row in a Table in the merging order (use Excel worksheet and paste in Word). (2) Select the table and merge cells (Table Tools > Layout > Merge Cells) to get multi-line single-column Table with paragraph mark at the end of each line except last line. (3) Replaces all paragraph marks with commas (Editing > Replace; Find what = ^p and Replace with = ,). (4) Convert table to text to get content of each cell separated by a comma in a single paragraph. (5) Replaces all commas with concatenation-operator or operators, & or &” “& as required (Editing > Replace; Find what = , and Replace with = & or &” “&). (6) Prefix “=” to the paragraph. Required formula is ready in text form. Copy and paste in Excel; it becomes a formula. (7) The same result can be achieved in MS Excel also through Editing > Fill > Justify but with limitations. (a) Width of merged text that can be displayed is equal to the width of cell where Justify is applied. Superfluous text is written in cells below as separate text. (b) Numbers are to be converted to text (Formulas > Text > TEXT(Value, Format_text). I am an Excel user only and I am sorry for my earlier inappropriate suggestion.
This comment was minimized by the moderator on the site
i need to change my text which in column 115 gm to 115. how it is possible. need to change text in to value like 115 in next column.
This comment was minimized by the moderator on the site
Hi, if you use the text to column feature you can do this. highlight the column in question, click on text to column, step through the process. It will ask you what your delimiter is, if there is a space between the quantity and the measurement (115 gm) you can use the space as your delimiter. PS... add a column to the right of your data column just incase it does something wonky on you.
This comment was minimized by the moderator on the site
I need to convert text from value to sort a large data. please help. For Example 115 gm (this is in shown as text) I need only 115 in next column to sort. Please reply help in this regards
This comment was minimized by the moderator on the site
[quote]I need to convert text from value to sort a large data. please help. For Example 115 gm (this is in shown as text) I need only 115 in next column to sort. Please reply help in this regardsBy Ahmed[/quote] 897/5000 Hi, if the numbers inside the text string are in correlative form, try this, in the formula bar type B1 (if the data column is in A1): = MID (A1, MIN (IFERROR (FIND ({0; 1; 2; 3; 4; 5; 6; 7; 8; 9}, A1), "")), COUNT (1: $ 98), 1))) And then press Ctrl + Shift + Enter because it is a matrix formula, ie at the beginning and end of the formula will appear {y}. Note that I use the comma (,), but it is likely that you must use the semicolon (;) to create both the array of digits and to separate the arguments of the function. I apologize if there is something wrong with the translation from Spanish, if it gives you an error in case I copy the formula in that language: = EXTRACT (A1, MIN (IF YOU FIND ({0; 1; 2; 3; 4; 5; 6; 7; 8; 9}, A1) , FILA ($ 1: $ 98), 1))) Original by Moisés Ortíz (https://exceltotal.com/extraer-numeros-de-una-celda-en-excel/)
This comment was minimized by the moderator on the site
I need to copy the results from a column with a formula to another column but I want just the results copied not the formula. In other words, I have a column with addresses. I have created another column and using a formula I have removed the house number and now just see the street name. Now I need to copy those results (street names only) to another column in a different spreadsheet, but when I try to do this it only copies the formula which of course then gives me the #ref error because the starting data isn't available. Any suggestions?
This comment was minimized by the moderator on the site
I am here because I have been trying to resolve a problem with file names. I have some 40 files with identical names except for the year 2 digits. I simply need to construct the file name (eg C:Docs\Research\...\[Year72.xlsx]Test!$B$10 ro retrieve the data out of that particular file cell B10. I can build the file name in the working workbook,and create the address (using Address), but cannot extract the data in that file cell using Indirect, as Indirect does not access closed files, and opening so many files is not an option. Have we got Microsoft or is there a workaround? as this requirement must be common. :
This comment was minimized by the moderator on the site
Assuming your text function is in A1; 1. Create a text string elsewhere which includes the equals sign eg. =CONCATENATE("@=",A1) 2. This will give you @=10+20, which you can now copy (paste values) to wherever you want it. 3. Finally, simply replace the @= with = using Ctrl+H as above. It's three steps, but it avoids VBA and doesn't take long.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations