Loncat ke daftar isi utama

Bagaimana cara mengubah string teks menjadi rumus di Excel?

Jika ada banyak string teks seperti format = A1 + B1 yang Anda perlukan untuk mengubah string teks ini menjadi rumus nyata dan menghitung nilainya di lembar kerja Anda, sayangnya, tidak ada metode langsung untuk menyelesaikannya di Excel. Tapi, di sini saya bisa membahas beberapa trik menarik untuk Anda.

Ubah string teks menjadi rumus dengan User Defined Function

Ubah string teks menjadi formula dengan Kutools for Excel


panah gelembung kanan biru Ubah string teks menjadi rumus dengan User Defined Function

Kode VBA singkat berikut dapat membantu Anda mengatasi masalah yang mengubah teks menjadi rumus sebagai langkah-langkah berikut:

1. Tahan ALT + F11 kunci, dan itu membuka Jendela Microsoft Visual Basic for Applications.

2. Klik Menyisipkan > Modul, dan tempel kode berikut di Jendela Modul.

Kode VBA: Ubah string teks menjadi rumus

Function Eval(Ref As String)
Application.Volatile
Eval = Evaluate(Ref)
End Function

3. Simpan kode ini dan kembali ke lembar kerja Anda, masukkan rumus ini = Evaluasi (C1) ke dalam sel kosong (C1 berisi sel string teks yang ingin Anda ubah menjadi rumus), lihat tangkapan layar:

doc-convert-text - ke-formula1

4. Lalu tekan Enter kunci, dan pilih sel D1, seret gagang isian ke kisaran yang ingin Anda terapkan rumus ini. Lihat tangkapan layar:

doc-convert-text - ke-formula1


panah gelembung kanan biru Ubah string teks menjadi formula dengan Kutools for Excel

Jika Anda tidak suka menggunakan kode di atas, Anda dapat mendaftar Kutools untuk Excel'S Ubah Teks menjadi Formula Fitur, dengan bantuannya, Anda juga dapat mengonversi string teks menjadi rumus sekaligus.

Kutools untuk Excel mencakup lebih dari 300 alat Excel yang praktis. Gratis untuk mencoba tanpa batasan dalam 30 hari. Dapatkan Sekarang.

Setelah menginstal Kutools for Excel, lakukan seperti ini:

1. Pilih string teks yang ingin Anda konversi.

2. Klik Kutools > Pengonversi Konten > Ubah Teks menjadi Formula, lihat tangkapan layar:

doc-convert-text - ke-formula1

3. Dan semua string teks pilihan Anda telah dikonversi ke rumus nyata dan mendapatkan nilainya juga. Lihat tangkapan layar:

doc-convert-text - ke-formula4 -2 doc-convert-text - ke-formula5

Untuk mengetahui lebih lanjut tentang fitur Konversi Teks ke Rumus ini.


Artikel terkait:

Bagaimana cara mengubah rumus menjadi string teks di Excel?

Alat Produktivitas Kantor Terbaik

馃 Kutools AI Ajudan: Merevolusi analisis data berdasarkan: Eksekusi Cerdas   |  Hasilkan Kode  |  Buat Rumus Khusus  |  Analisis Data dan Hasilkan Grafik  |  Aktifkan Fungsi Kutools...
Fitur Populer: Temukan, Sorot, atau Identifikasi Duplikat   |  Hapus Baris Kosong   |  Gabungkan Kolom atau Sel tanpa Kehilangan Data   |   Putaran tanpa Formula ...
Pencarian Super: VLookup Beberapa Kriteria    VLookup Nilai Berganda  |   VLookup di Beberapa Lembar   |   Pencarian Fuzzy ....
Daftar Drop-down Lanjutan: Buat Daftar Drop Down dengan Cepat   |  Daftar Drop Down yang Bergantung   |  Multi-pilih Drop Down List ....
Manajer Kolom: Tambahkan Jumlah Kolom Tertentu  |  Pindahkan Kolom  |  Alihkan Status Visibilitas Kolom Tersembunyi  |  Bandingkan Rentang & Kolom ...
Fitur Unggulan: Fokus Kisi   |  Tampilan Desain   |   Bar Formula Besar    Manajer Buku Kerja & Lembar   |  Perpustakaan Sumberdaya (Teks otomatis)   |  Pemetik tanggal   |  Gabungkan Lembar Kerja   |  Enkripsi/Dekripsi Sel    Kirim Email berdasarkan Daftar   |  Filter Super   |   Filter Khusus (filter tebal/miring/coret...) ...
15 Perangkat Teratas12 Teks Tools (Tambahkan Teks, Hapus Karakter, ...)   |   50 + Grafik jenis (Gantt Chart, ...)   |   40+ Praktis Rumus (Hitung usia berdasarkan ulang tahun, ...)   |   19 Insersi Tools (Masukkan Kode QR, Sisipkan Gambar dari Jalur, ...)   |   12 Konversi Tools (Angka ke Kata, Konversi Mata Uang, ...)   |   7 Gabungkan & Pisahkan Tools (Lanjutan Gabungkan Baris, Pisahkan Sel, ...)   |   ... dan banyak lagi

Tingkatkan Keterampilan Excel Anda dengan Kutools for Excel, dan Rasakan Efisiensi yang Belum Pernah Ada Sebelumnya. Kutools for Excel Menawarkan Lebih dari 300 Fitur Lanjutan untuk Meningkatkan Produktivitas dan Menghemat Waktu.  Klik Di Sini untuk Mendapatkan Fitur yang Paling Anda Butuhkan...

Deskripsi Produk


Tab Office Membawa antarmuka Tab ke Office, dan Membuat Pekerjaan Anda Jauh Lebih Mudah

  • Aktifkan pengeditan dan pembacaan tab di Word, Excel, PowerPoint, Publisher, Access, Visio, dan Project.
  • Buka dan buat banyak dokumen di tab baru di jendela yang sama, bukan di jendela baru.
  • Meningkatkan produktivitas Anda sebesar 50%, dan mengurangi ratusan klik mouse untuk Anda setiap hari!
Comments (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I am finding this to be not working properly. As everyone else has said (and I could not see a satisfactory solution), it does not work when trying to pull in stuff from other worksheets in the same workbook. It's frustrating and I am having to give up on this and find another solution. So the Google search continues!
This comment was minimized by the moderator on the site
Thank you very much!!! GREAT IDEA!!!
This comment was minimized by the moderator on the site
Hello
For the first defined function way, I have a problem.
when the resources for concatenate function are in another worksheet, Eval function works properly when that resource worksheet is open, But immediately when I close that resource worksheet, Eval function Not working. How I can change the codes for eval function to use closed resource worksheets?
This comment was minimized by the moderator on the site
Hello Johnny
about Hussein鈥檚 issue, if the external workbook is closed INDIRECT gives #REF! error. Do you have other solution?
This comment was minimized by the moderator on the site
use indirect only works with open workbooks.


solution is to use indirect.ext from morefunc.


regards,
Hasan nasralla
This comment was minimized by the moderator on the site
Hi Hussein,

Just use the INDIRECT function in Excel. Does the same thing.
This comment was minimized by the moderator on the site
Greetings, the above code works perfectly inside the same workbook across different sheets, but in case i have a cell reference to an external workbook it returns #VALUE!. the formulas were calculating normally earlier.
Example for the formula can't be evaluated correctly: IFERROR(INDEX('[Tracking-OSP Outside Riyadh-07-09-2017.xlsx]Tracking WO'!$U$3:$U$19000,MATCH(A3&"",'[Tracking-OSP Outside Riyadh-07-09-2017.xlsx]Tracking WO'!$B$3:$B$19000,0)),INDEX('[Tracking-OSP Outside Riyadh-07-09-2017.xlsx]Tracking WO'!$U$3:$U$19000,MATCH(value(A3),'[Tracking-OSP Outside Riyadh-07-09-2017.xlsx]Tracking WO'!$B$3:$B$19000,0))).
This comment was minimized by the moderator on the site
The replace = with = works, so relieved. Thank you to whoever discovered and shared this nugget of Excel gold.
This comment was minimized by the moderator on the site
To clarify my other comment, I mass replaced the "=" character with the same "=" character, and that made the strings turn into formulas.
This comment was minimized by the moderator on the site
Hi Rich,
I'm just reading you comment on turning text into a formula. It seems that the function as mentioned above is not working. I'm not really a programmer but what i did is converting a formula into a text and in the text i have to replace a few values and combine it again in one text but now i need to convert it back into a formula. Could you give me a tip.
Regards
Frans
This comment was minimized by the moderator on the site
I don't know if this would always work, but I had a number of cells that had formulas stored as text strings. I did a full worksheet find replace on the "=" character, and all of my strings converted to formulas with that one action.
This comment was minimized by the moderator on the site
Thank you. Works well with the user defined function... I could do what I could not using the default functions of INDIRECT, ADDRESS et al provided. It fell short when I had a range to be input.
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