Excel · मराठी आवृत्ती
3.13 IF, nested IF आणि IFS
Condition खरी असेल तर एक answer, नाहीतर दुसरा — हे IF चं काम.
=IF(logical_test, value_if_true, [value_if_false])| काय करायचं आहे? | Formula | Row 11 result |
|---|---|---|
| Late की On time | =IF(H2>15,"Late","On time") |
Late — 17 minutes |
| ₹199 किंवा त्याहून जास्त amount ला fee 0 | =IF(G2>=199,0,25) |
25 |
=IF(H2>15,"Late","On time") मध्ये 15 मिनिटांपेक्षा जास्त वेळ असेल तर Late. =IF(G2>=199,0,25) मध्ये ₹199 किंवा त्याहून जास्त amount असेल तर delivery fee 0, बाकी ₹25.
दोनपेक्षा जास्त outcomes
एका IF मध्ये आणखी IF म्हणजे nested IF:
=IF(G2>=1000,"Premium",IF(G2>=200,"Regular","Small"))
IFS — Excel 2019+ — conditions क्रमाने तपासतो. पहिली TRUE condition जिंकल्यावर तिचा answer येतो:
=IFS(G2>=1000,"Premium", G2>=200,"Regular", TRUE,"Small")
| Amount | Result |
|---|---|
| 1,299 | Premium |
| 270 | Regular |
| 90 | Small |
₹1,299 → Premium; ₹270 → Regular; ₹90 → Small.
Practice
Sales ₹1,00,000 पेक्षा जास्त असतील तर 10% bonus, नाहीतर 5% असा formula करा. Delivery time ≤10 Excellent, ≤15 Good, बाकी Needs Improvement असा grade तयार करा.