1. Excel ν¨μ
λ°μ΄ν°λ₯Ό κ³μ°, λΆμ λλ μ‘°μνκΈ° μν΄ λ―Έλ¦¬ μ μλ μμμ λλ€.
ν¨μλ νΉμ ν κ°μ μ λ ₯λ°μ κ²°κ³Όλ₯Ό λ°ννλ©°, SUM, AVERAGE, VLOOKUP κ°μ λ€μν μ νμ΄ μμ΅λλ€.
μ΄λ₯Ό ν΅ν΄ 볡μ‘ν κ³μ°μ μλννκ³ ν¨μ¨μ±μ λμΌ μ μμ΅λλ€.
1-1 Excel ν¨μλ₯Ό ν΅ν΄ μ°¨νΈ λ§λ€κΈ°
- λ°μ΄ν° μ€λΉ: λ¨Όμ , ν¨μλ₯Ό μ¬μ©νμ¬ νμν λ°μ΄ν°λ₯Ό κ³μ°ν©λλ€.
μλ₯Ό λ€μ΄, SUM, AVERAGE, λλ VLOOKUP ν¨μλ₯Ό μ΄μ©ν΄ ν©κ³, νκ· , νΉμ κ°μ κ³μ°ν ν κ²°κ³Όλ₯Ό νλ‘ μ 리ν©λλ€. - μ°¨νΈ λ²μ μ€μ : ν¨μλ‘ κ³μ°λ λ°μ΄ν°λ₯Ό ν¬ν¨νλ μ
λ²μλ₯Ό μ νν©λλ€. μ΄ λ°μ΄ν°λ μ°¨νΈμ νμλ κ°μ΄ λ©λλ€.
- μ°¨νΈ μμ±: μμ
μ μ°¨νΈ λꡬλ₯Ό μ¬μ©ν΄ μ νν λ°μ΄ν°λ₯Ό λ°νμΌλ‘ μ ν©ν μ°¨νΈ μ ν(μ: λ§λν, μ ν, μν λ±)μ μμ±ν©λλ€.
μ΄λ ν¨μλ‘ κ³μ°λ λ°μ΄ν°λ μλμΌλ‘ μ°¨νΈμ λ°μλμ΄ μκ°μ μΌλ‘ ννλ©λλ€.
2. ChatGPTλ₯Ό νμ©ν Excel ν¨μ μ¬μ©λ²
2-1 μ±μ μ²λ¦¬
• μ 무 μ€λͺ
[score.xlsx νμΌ]μ μ¬μ©νμ¬ νμλ€μ κ΅μ΄, μμ΄, μν μ μ λ°μ΄ν°λ₯Ό κ°μ§κ³
κ°μΈλ³μ΄μ ,κ³Όλͺ©λ³μ΄μ , μμ°¨λ₯Ό ꡬνκ³ λ°μ°¨νΈλ‘ νμν΄λ³΄μ
• ν둬ννΈ
1. νμλ€μ κ°μΈλ³μ΄μ μ ꡬν μ μλ μμ ν¨μλ₯Ό μλ €μ€
2. νμλ€μ κ³Όλͺ©λ³μ΄μ μ ꡬν μ μλ μμ ν¨μλ₯Ό μλ €μ€
3. κ°μΈμ΄μ μ λ°λ₯Έ μμ°¨λ₯Ό ꡬν μ μλ μμ ν¨μλ₯Ό μλ €μ€
4. XμΆμ νμλͺ μΌλ‘ νκ³ YμΆμ κ΅μ΄,μμ΄,μνμ μλ‘ νλ λ°μ°¨νΈλ₯Ό νμν΄ μ€.
λ¨, 8νμ μ μΈν΄ μ£Όκ³ νμλͺ κ³Ό κ³Όλͺ©λͺ μ μλ¬ΈμΌλ‘ λ²μν΄μ€
• κ²°κ³Ό
# Update the dataframe to use English for student names and subject names
df_english = df.copy()
df_english.columns = ['Name', 'Korean', 'English', 'Math', 'Total Score', 'Rank']
# Manually translating names (assuming these are common Korean names)
name_translation = {
'νκΈΈλ': 'Hong Gil-dong',
'κ°κ°μ°¬': 'Gang Gam-chan',
'μ΄μμ ': 'Yi Sun-sin',
'κΉκΈΈλ': 'Kim Gil-dong',
'μ΅κ°μ°¬': 'Choi Gam-chan'
}
df_english['Name'] = df_english['Name'].map(name_translation)
# Plot the updated chart with English labels
students_english = df_english['Name'].iloc[:6]
plt.figure(figsize=(10, 6))
bar_width = 0.25
index = range(len(students_english))
plt.bar(index, df_english['Korean'].iloc[:6], bar_width, label='Korean')
plt.bar([i + bar_width for i in index], df_english['English'].iloc[:6], bar_width, label='English')
plt.bar([i + 2 * bar_width for i in index], df_english['Math'].iloc[:6], bar_width, label='Math')
plt.xlabel('Student')
plt.ylabel('Score')
plt.title('Korean, English, Math Scores by Student')
plt.xticks([i + bar_width for i in index], students_english)
plt.legend()
plt.tight_layout()
plt.show()
• μμ±λ Barμ°¨νΈ
2-2 κ°λ³ μ μ°μ‘ κ³μ°
• μ 무 μ€λͺ
[sample.xlsx νμΌ]μ μ¬μ©νμ¬ κ°λ³ μ μ°μ‘μ κ³μ°νμ¬ I4~I13μ νμν΄λ³΄μ
• ν둬ννΈ
μμ μμ Gμ΄μμ Hμ΄μ κ°μ λΉΌλ μμμ μμ±ν΄μ€.
Gμ΄μ G2λΆν° G11κΉμ§ μκ³ , Hμ΄μ G2λΆν° H11κΉμ§ μμ΄.
κ·Έλ¦¬κ³ μ΄κ±Έ I2μ΄λΆν° I11μ΄μ μ λ ₯νκ³ μΆμ΄.
μ λ ₯ν΄μ sample_1.xlsxνμΌλ‘ λ€μ΄λ‘λ λ°μ μ μλλ‘ ν΄μ€
• κ²°κ³Ό
# Perform the subtraction between 'κ²°μ μ‘' (G) and 'PGμμλ£' (H), storing the result in a new column 'I'
df['μ°¨μ‘'] = df['κ²°μ μ‘'] - df['PGμμλ£']
# Save the updated dataframe to a new Excel file
output_path = '/mnt/data/sample_1.xlsx'
df.to_excel(output_path, index=False)
output_path
• μμ±λ Excel νμΌ
2-3 μ΄ μ μ°μ‘ κ³μ°
• μ 무 μ€λͺ
[sample_1.xlsx νμΌ]μ μ¬μ©νμ¬ μ΄ μ μ°μ‘μ ν©κ³λ₯Ό I13μ νμν μ μλ ν¨μλ₯Ό ChatGPTμ μμ²ν΄λ³΄μ
• ν둬ννΈ
I2μμ I11μ κ°μ ν©κ³νμ¬ I13μ νμνλ €κ³ ν΄. μ¬μ©ν ν¨μλ₯Ό μλ €μ€
• κ²°κ³Ό
=SUM(I2:I11)
μ΄ κ³΅μμ I13 μ μ μ λ ₯νλ©΄ I2μμ I11κΉμ§μ κ°μ΄ λͺ¨λ ν©μ°λμ΄ νμλ©λλ€.
2-4 κ²°μ μλ¨μ λ°λ₯Έ μ μ°μ‘ κ³μ°
• μ 무 μ€λͺ
[sample_1.xlsx νμΌ]μ μ¬μ©νμ¬ κ²°μ μλ¨μ λ°λ₯Έ μ μ°μ‘μ ν©κ³λ₯Ό ꡬνλ ν¨μλ₯Ό
ChatGPTμκ² μμ²ν΄μ κ²°μ μλ¨μ λ°λ₯Έ μ μ°μ‘ κ³μ°
• ν둬ννΈ
Cμ΄μ μ μ©μΉ΄λμ κ°μκ³μ’μ λν΄ κ°κ°'κ²°κ³Ό'μ΄μ ν©κ³λ₯Ό κ³μ°ν΄μ
μ μ©μΉ΄λν©κ³μ κ°μκ³μ’ν©κ³λ₯Ό νμνκ³ sample_2.xlsxλ‘ λ€μ΄λ‘λν μ μκ² ν΄μ€
• κ²°κ³Ό
# Load the updated Excel file
file_path_updated = '/mnt/data/sample_1.xlsx'
df_updated = pd.read_excel(file_path_updated)
# Calculate the sum for 'μ μ©μΉ΄λ' and 'κ°μκ³μ’' in the 'κ²°μ μλ¨' column and sum their corresponding 'μ°¨μ‘'
credit_card_sum = df_updated[df_updated['κ²°μ μλ¨'] == 'μ μ©μΉ΄λ']['μ°¨μ‘'].sum()
virtual_account_sum = df_updated[df_updated['κ²°μ μλ¨'] == 'κ°μκ³μ’']['μ°¨μ‘'].sum()
# Add these sums as new rows in the dataframe
df_updated.loc[len(df_updated.index)] = ['']*len(df_updated.columns) # Adding an empty row
df_updated.loc[len(df_updated.index)] = ['μ μ©μΉ΄λν©κ³', '', '', '', '', '', '', '', credit_card_sum]
df_updated.loc[len(df_updated.index)] = ['κ°μκ³μ’ν©κ³', '', '', '', '', '', '', '', virtual_account_sum]
# Save the updated dataframe to a new Excel file
output_path_2 = '/mnt/data/sample_2.xlsx'
df_updated.to_excel(output_path_2, index=False)
output_path_2
• μμ±λ Excel νμΌ
2-5 μ μ©μΉ΄λ κΈ°κ΄μ μ μΉ΄μ΄νΈ
• μ 무 μ€λͺ
[sample_2.xlsx νμΌ]μ μ¬μ©νμ¬ μ μ©μΉ΄λ κΈ°κ΄μ μλ₯Ό μΉ΄μ΄νΈνλ ν¨μλ₯Ό ChatGPTμ μμ²
• ν둬ννΈ
Cμ΄μ μ μ©μΉ΄λμ κ°μκ³μ’μ λν΄ κ°κ°'κ²°κ³Ό'μ΄μ ν©κ³λ₯Ό κ³μ°ν΄μ
μ μ©μΉ΄λν©κ³μ κ°μκ³μ’ν©κ³λ₯Ό νμνκ³ sample_2.xlsxλ‘ λ€μ΄λ‘λν μ μκ² ν΄μ€
• κ²°κ³Ό
# Calculate the sum for 'μ μ©μΉ΄λ' and 'κ°μκ³μ’' in the 'κ²°μ μλ¨' column and sum their corresponding 'μ°¨μ‘'
credit_card_sum_final = df_new[df_new['κ²°μ μλ¨'] == 'μ μ©μΉ΄λ']['μ°¨μ‘'].sum()
virtual_account_sum_final = df_new[df_new['κ²°μ μλ¨'] == 'κ°μκ³μ’']['μ°¨μ‘'].sum()
# Add these sums as new rows in the dataframe
df_new.loc[len(df_new.index)] = ['']*len(df_new.columns) # Adding an empty row
df_new.loc[len(df_new.index)] = ['μ μ©μΉ΄λν©κ³', '', '', '', '', '', '', '', credit_card_sum_final]
df_new.loc[len(df_new.index)] = ['κ°μκ³μ’ν©κ³', '', '', '', '', '', '', '', virtual_account_sum_final]
# Save the updated dataframe to a new Excel file
output_path_final = '/mnt/data/sample_2_final.xlsx'
df_new.to_excel(output_path_final, index=False)
output_path_final
• μμ±λ Excel νμΌ
'πͺπππππππ πΊππππππ π¬ > AI κΈ°λ° ChatGPT νμ©' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[ChatGPT νμ©] ChatGPTλ₯Ό νμ©ν GAS μ¬μ©λ² (0) | 2024.08.29 |
---|---|
[ChatGPT νμ©] ChatGPTλ₯Ό νμ©ν VBA, VBS μμ± (0) | 2024.08.26 |
[ChatGPT νμ©] ChatGPTλ₯Ό νμ©ν Excel μ¬μ©λ² (0) | 2024.08.16 |
[ChatGPT νμ©] ChatGPTλ₯Ό νμ©ν μλΉμ€ & λ°μ΄ν°νλ μ μμ± (0) | 2024.08.13 |
[ChatGPT νμ©] ChatGPTμ ν¨κ³Όμ μΈ prompt μ¬μ©λ² (0) | 2024.08.10 |