Automatically translated.View original post

Use If to extract the required data

2025/8/9 Edited to

... Read moreถ้าใครกำลังงงกับ “คำสั่ง IF” หรืออยากทำ “สูตร IF หลายเงื่อนไข” เพื่อแยกข้อมูลใน Excel แบบในตารางสินค้า (เช่น CATE = fruits/vegetable/meat แล้วอยากดึงเฉพาะรายการที่เป็น fruits) เราสรุปวิธีที่ใช้บ่อยให้แบบนำไปใช้ได้ทันทีค่ะ 1) IF เงื่อนไขเดียว (พื้นฐานที่ต้องรู้) โครงสร้างคือ =IF(เงื่อนไข, ค่าถ้าจริง, ค่าถ้าเท็จ) ตัวอย่าง: ถ้า B2 คือหมวดหมู่ (CATE) อยากให้คอลัมน์ใหม่ขึ้นคำว่า “ผลไม้” เมื่อเป็น fruits =IF(B2="fruits","ผลไม้","") อันนี้เหมาะกับการ “แยกข้อมูลที่ต้องการ” ออกมาเป็นคอลัมน์ช่วย แล้วค่อยกรอง (Filter) เอาเฉพาะที่ไม่ว่าง 2) สูตร IF หลายเงื่อนไขแบบซ้อน (Nested IF) กรณีมีหลายหมวดและอยากให้ขึ้นข้อความต่างกัน เช่น fruits/vegetable/meat =IF(B2="fruits","ผลไม้",IF(B2="vegetable","ผัก",IF(B2="meat","เนื้อสัตว์","อื่นๆ"))) ทริก: ถ้าหมวดเยอะมาก Nested IF จะยาวและพลาดง่าย แนะนำใช้ IFS (ถ้ามีใน Excel เวอร์ชันของคุณ) =IFS(B2="fruits","ผลไม้",B2="vegetable","ผัก",B2="meat","เนื้อสัตว์",TRUE,"อื่นๆ") 3) IF หลายเงื่อนไขด้วย AND/OR (ใช้ตอนต้องเช็คมากกว่า 1 ช่อง) เช่น อยากแยกเฉพาะ “fruits ที่ QTY มากกว่า 50” =IF(AND(B2="fruits",C2>50),"fruits-qtyสูง","") หรืออยากให้เข้าเงื่อนไขอย่างใดอย่างหนึ่ง (fruits หรือ vegetable) =IF(OR(B2="fruits",B2="vegetable"),"กลุ่มพืช","") 4) Excel สูตร IF แยกสี (แนวทางที่คนค้นหาบ่อย) Excel ไม่สามารถ “อ่านสีเซลล์” ด้วย IF ได้ตรงๆ แบบไม่ใช้ตัวช่วย (เช่น VBA หรือ Add-in) แต่ที่ทำได้ง่ายและนิยมกว่า คือ “แยกตามเงื่อนไขแล้วให้ติดสี” ด้วย Conditional Formatting ตัวอย่าง: อยากให้แถวที่เป็น fruits เป็นสีเขียว Home > Conditional Formatting > New Rule > Use a formula ใส่สูตร: =$B2="fruits" แล้วเลือกสีเติม (Fill) ตามต้องการ ข้อดีคือแยกสีได้อัตโนมัติและไม่ต้องพึ่งแมโคร 5) ต่อจาก IF ไปเป็นการสรุปผลด้วย COUNTIF/SUMIF/AVERAGEIF พอเราแยกหมวดได้แล้ว มักจะอยากสรุปยอด เช่น - รวมจำนวน (QTY) เฉพาะ fruits: =SUMIF(B:B,"fruits",C:C) - นับจำนวนรายการที่เป็น fruits: =COUNTIF(B:B,"fruits") - หาเฉลี่ย QTY ของ fruits: =AVERAGEIF(B:B,"fruits",C:C) ส่วนตัวเวลาเจอตาราง PRODUCT / CATE / QTY เราจะทำคอลัมน์ช่วยด้วย IF/IFS ให้ชัดก่อน แล้วค่อยใช้ SUMIF/COUNTIF สรุป จะเร็วและตรวจสอบง่ายมากค่ะ

Related posts

Jobs in Healthcare| Degree not required🧠🦻🏻🩺
Hey Girlies✨🫶🏻 I’ve noticed that my healthcare posts get quite the attention so I figured I would share a little more career information on it! So here are some healthcare jobs that don't require a college degree but still offer good pay and job satisfaction: 🦻🏻Audiology Technician Wh
Emilyyy

Emilyyy

8646 likes

4 ingredients No kneading required ! 🍞
Ingredients: 3 cups flour 1 tsp salt 1 tablespoon yeast 11/2 cup warm water or a 1/3 cup more if needed. Let it rise for 1-2 hours 450 for 30 minutes with lid on. Another 15 minutes lid off. #breadideas #easyrecipe #breadforbeginners #homemade #easyrecipes
Anne Sichler 🎀

Anne Sichler 🎀

2234 likes

100 CONTENT IDEAS‼️(NO 💵 required)
These content ideas can be created with what you already have and without spending any money. Can’t wait to see the ones you guys pick 🫶 #contentcreatortipsforbeginners #creatorideas #fypシ゚
𝚃𝚑𝚎𝚛𝚎𝚜𝚊 𝙹𝚊𝚒

𝚃𝚑𝚎𝚛𝚎𝚜𝚊 𝙹𝚊𝚒

10.9K likes

NO STARTER REQUIRED
You don’t need a sour dough starter to have fresh bread! Base recipes on pic 2 Optional add ins: Jalapeño cheddar Rosemary garlic Half the recipe for a personal loaf! #bread #breadrecipe
hannahvbrown

hannahvbrown

2143 likes

No cooking required
My fav lunch to take to work. All you need to do is chop up some cucumber, add 1 can of chickpeas, 1 can of kidney beans, sprinkle in some feta, and squeeze one fresh lemon. #lunches #lunchesforwork #healthyfood #healthylunchideas #easyrecipe
Hayley 🍒

Hayley 🍒

1699 likes

Pre-Med Must-Haves 🧠📚: Required Courses ✏️🩺
Thinking about med school? 🩺 Here’s a quick look at the required courses you’ll need for pre-med, dental, PA, and more! 📚 I wish I had this when planning my schedule—save it for later! ✏️ Let’s survive orgo together! #premed #futuredoctor #studyguide #collegeprep #studentlife Northe
Shelby🩺🩻💉

Shelby🩺🩻💉

142 likes

Soft Life, No Plans Required
Exactly where I want to be 🏡❤️ #softlife #homebody #simpleliving #homecooking #nightroutine
Ko-Ko Owirodu

Ko-Ko Owirodu

107 likes

Sell Digital Products No Face Required
You don't have to spend a month creating a digital product that may not even sell! Instead get a done for you product you can resell as your own. This Faceless Kit will help you start your own faceless account and you can also resell the bundle to others! Inside are hundreds of facel
Digital Babe

Digital Babe

113 likes

The image shows a modern room with a city night view, featuring a TV and furniture. Overlay text announces "Remote Jobs No Talking/For Girls Pt. 25 *all ages*", indicating a list of remote job opportunities.
A pink graphic advertises a "Song reviewer" remote job for $28 an hour, offering flexible hours to review music. It includes a red "P" logo and application details.
A pink graphic advertises a "Discord Moderater" remote job for $27 an hour, involving removing spam comments with bonus pay. It features the Discord logo and application details.
Remote Jobs No Talking Required 💗
#RemoteJobs #WorkFromHome #RemoteWork #DigitalNomad #WorkAnywhere #OnlineJobs #RemoteCareer #JobSearchTips #WorkFromHomeLife #FreelanceLife
Demitra

Demitra

25 likes

get free PR - no followers required
no following? no problem. this pr email list from brandz app gives you direct contacts—perfect for beginners and micro-influencers ready to pitch #ugc #prpackages #brands #prpackage #ugctips
lilyyarrow

lilyyarrow

744 likes

An open book with dense text rests on a green textured surface, featuring a text overlay that reads 'accessible essay collections that will make you a more interesting person!'.
A hand holds Virginia Woolf's 'A Room of One's Own' with a light-colored cover, against a white bookshelf. An overlay describes it as a classic urging women to build a life independent from men.
A hand holds Jia Tolentino's 'Trick Mirror' with an orange cover and pink text, against a white bookshelf. An overlay describes it as an examination of contemporary culture for feeling seen and understood.
these essays should be required reading
I prefer essay collections to general books of nonfiction because they tend to be more accessible and way less intimidating. By breaking out a concept into easy to digest essays, the reader is able to absorb the information in their own time and can take breaks between essays until they’re ready fo
dakota bossard

dakota bossard

178 likes

A handwritten journal page titled 'Luke 12:48 Much Is Required' features text about stewarding God-given gifts, talents, and opportunities to bless others. It includes sections for reflection, reminders, and a prayer, adorned with drawings of a red rose, a yellow sunflower, and various small colorful flowers.
Much Is Required 🙏🏾💯🩷
…to whom much is given, much will be required… 🙏🏾 Luke 12:48 Follow me for more positivity and encouragement? @AtlBeauty_404 🙏🏾🙏🏾🙏🏾 #findgod🙏🏼📖 #believer🙏🏽 #godfirst🙏🏽 #lemon8challenge #Lemon8Diary
AtlBeauty_404

AtlBeauty_404

170 likes

EASILY Fix a loose plug, NO TOOLS REQUIRED 🤯
🤯 ANYONE CAN DO THIS 2 SECOND HACK TO FIX THE MOST ANNOYING HOME PROBLEM! Try this gamechanging Homehack. 📣 RENTAL FRIENDLY AND SO EASY!! For me, I don’t ever attempt to fix anything electrical, and because I am pretty budget conscious, I only call in a professional when I absolutely have to.
KISSparkles

KISSparkles

994 likes

A woman in a white outfit smiles and waves, with the text 'Tools Required for Some Careers in Data' overlaid. She is in a modern space with a green moss wall.
A woman sits on a yellow couch using a laptop, with a green moss wall behind her. Text labels 'Data Analyst' and lists tools: SQL, Power BI, Python, Lucid Chart, SQL server.
A woman sits on a yellow couch using a laptop, with a green moss wall behind her. Text labels 'Analytics Engineer' and lists tools: Dbt, SQL, Python, Git, Power BI, Snowflake.
Tools Required for Some Careers in Data
I wanted to share some of the tools that have helped me along my unconventional career journey. Each tool has been a game-changer in shaping my path and workflow. Where are you in your career right now? And what tools are helping you grow or stay productive? Let’s chat in the comments! #lemo
NeLo

NeLo

10 likes

A person holds a stack of college books, covering their face, with text asking an English Major for an honest review of required reading. The image features a Lemon8 logo.
A dog looks at an open copy of Fyodor Dostoevsky's 'The Brothers Karamazov,' described as a loved novel and a beautiful story of forgiveness. The image includes a Lemon8 logo.
A dog lies next to three Dante books: 'Inferno,' 'Purgatorio,' and 'Paradiso,' which are described as dragging and self-indulgent. The image features a Lemon8 logo.
required reading - what i loved & what i didn't
hi friends! 🌈 i graduated a few years ago and thought this might be fun to make!! 📜 i graduated with a bachelor's degree in English and n e a r l y a minor in theatre / philosophy (my schedule didnt work for either one, so i ended up being a few credits short of a double minor lol) 👩‍🎓
Grace Anne

Grace Anne

252 likes

Remote jobs no degree required ✨
#remotejobs #wfh #wfhjobs
Jobswithporsche

Jobswithporsche

19 likes

No man was required for this DIY
Kelly Cosgrove

Kelly Cosgrove

541 likes

A hand holds a stack of feminist nonfiction books against a wall decorated with framed art. The image features the text 'Feminist nonfiction' and the Lemon8 logo with username.
A hand holds 'Women Who Run With the Wolves' by Clarissa Pinkola Estés, described as exploring the wild feminine spirit through stories and myths. The Lemon8 logo is visible.
A hand holds 'Three Women' by Lisa Taddeo, described as an exploration of the sexual and emotional lives of three women. The Lemon8 logo is visible.
nonfiction that should be required reading
Here are some of my favorite nonfiction reads that all center around feminist ideals. Some are more spiritual, some are historical, and some were written one hundred years ago. All of them have insightful meditations on what it means to be a woman and how we can maintain agency over our bodies and
dakota bossard

dakota bossard

75 likes

Self-Care is REQUIRED
You may be a Mother, Wife, Caregiver and even a Mentor, please take care of yourself, Mentally ,Physically and don’t forget Spiritually that is Always First ! NOTHING is impossible when you Keep GOD First ♥️♥️♥️✝️✝️ Blessings to ALL
BECOMING,All About the Beauty

BECOMING,All About the Beauty

6 likes

feminist novels that should be required reading
The best kind of feminist literature is historical. I love reading about world history through the lens of a woman. They provide more context than what we learn in history class growing up, and these stories in particular happen to be expertly told, gripping and astounding accomplishments. All thre
dakota bossard

dakota bossard

38 likes

An infographic titled 'Turmeric: 10 Best DIY's For Flawless Skin' showing five DIY remedies. It illustrates ingredients like turmeric, aloe vera, cucumber for dark circles; turmeric, flour, milk for facial hair; turmeric, green tea, aloe vera for wrinkles; turmeric, potato, lemon for dark spots; and turmeric, honey, neem for acne, along with their benefits.
10 Best Ways to Use Turmeric for Clear & Flawless
📍Patch Test Reminder: Always do a patch test before applying turmeric to your face. Apply a small amount behind your ear and wait 24 hours to rule out any allergies. Turmeric can temporarily stain the skin yellow, so use dark-colored towels and wear old clothes during application. 🎀1. Turmeric f
Mira-san👒🌸

Mira-san👒🌸

1088 likes

No Espresso Machine Required!
RECIPE ⬇️ • I just add a dash of pumpkin spice to 1-2 tbs of my salted maple vanilla syrup ( homemade coffee syrup recipe ⬇️) • Froth into 1/2 cup Oat Milk • Ice • 1/2 cup Tazo espresso chai 🙌🏼🤎 • Enjoy! ☺️☕️ SYRUP RECIPE: • 1 cup real maple syrup • 1 cup water • 1 Tbs vanilla be
The Thrift Witch

The Thrift Witch

258 likes

No Pitching Required
Although it’s not completely useless, pitching to brands can be exhausting. I still pitch to brands regardless because consistency is key, HOWEVER— wouldn’t it be better if brands came to you? 👉🏼 Most of my Paid Deals have come from Brands reaching out to me on DM to work with me because: A.
Monica Silva

Monica Silva

118 likes

A woman wearing a dark blue NFL Titans jersey with the number 22 is relaxing on a light brown sofa. She has her hair in a bun, gold hoop earrings, and an anklet. A blue pillow with the Titans logo is visible next to her, suggesting a cozy home aesthetic.
Just vibing. No halftime show required
#cozyaesthetic #homeaesthetic #footballoutfitideas #lemon8lifestyle #geminiai Nashville
Chrissy M

Chrissy M

1106 likes

NO INTERVIEW REQUIRED
#wfh #remotejobs #remotework #fyp
TAYLOR BROWN 👩🏾‍💻🎀

TAYLOR BROWN 👩🏾‍💻🎀

26 likes

Required reading for writers!
A fun fact about me is that I am a writer! I actually finished writing my first novel last fall and I’m in the trenches of trying to find a literary agent. These are some of the books on writing that helped me get across the finish line. Writing is such an emotional and difficult thing to do regula
dakota bossard

dakota bossard

33 likes

Bread Recipe - no machine required
Bread recipe so easy my toddlers can do it… . . SIMPLE BREAD RECIPE - no machine required 1 2/3 cup warm water 2 1/4 tbsp yeast (active, quick rise, etc) 1 1/2 tsp of butter 1 tsp sugar 4 cups of flour 1 tbsp honey 1/2 tsp salt SERIOUSLY SO SIMPLE. Combine warm water, su
Crystal ✨🌹

Crystal ✨🌹

136 likes

Full Body Strength Training: No Gym Required!
Bodyweight workouts are a fantastic way to build strength and tone muscles, right from the comfort of your home. Here’s a full-body routine using just your bodyweight and a pair of dumbbells: 1. Squats Squats target your legs, glutes, and core, helping to strengthen and tone your lower
laysia

laysia

37 likes

A person in workout attire takes a mirror selfie in a gym, showcasing their glutes. Overlaid text details a 'Glutes WORKOUT ROUTINE' including warm-up, resistance band, lifting, and stairmaster, alongside advice to 'Prioritize your protein intake' based on weight for body transformation.
Your required intake is based on your weight
3 Tips to change physique: Weight training More protein intake Rest #bodytransformation #glutesworkout #glutegains Boston
ThaFitGoddess

ThaFitGoddess

73 likes

🕯️ My Soft Glow-Up Habits (No 4AM Club Required)
📋 Caption: We’re not forcing change — we’re flowing into it. My soft glow-up isn’t about pressure or hustle. It’s about aligning with the woman I know I’m becoming. ✨ Soft Glow-Up Habits I’m Loving: 1. Skin care with candlelight 🧴 2. Wearing soft sets that make me feel b
Sam

Sam

141 likes

See more