# 3.13 IF, nested IF आणि IFS

Source: https://ravindrabagale.com/mr/excel/ch03-formulas-and-functions/3-13-if-nested-if-and-ifs.html
Language: mr (Marathi with English technical terms)

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 तयार करा.

रवींद्र बागले यांची tip

मोठ्या amount ची condition नंतर ठेवली तर ₹1,299 सुद्धा Regular मध्ये जाऊ शकतं. Conditions चा क्रम तपासा. IFS मध्ये शेवटचं TRUE हे default answer साठी ठेवा. खूप levels झाले तर lookup table अधिक सोपी पडते.
