This works in Google Sheets for sure. Should work in Excel too.
With the appropriate cells selected, navigate to:
Google Sheets : Format -> Number -> More Formats -> Custom Number Format
Excel : Format -> Cells -> Custom -> [Custom text box]
Enter one of the following and Apply:
A] For Lakhs and Crores with the Rupee symbol and decimals
[$₹][>9999999]##\,##\,##\,##0.00;[$₹][>99999]##\,##\,##0.00;[$₹]##,##0.00
B] For Lakhs and Crores with the Rupee symbol and without decimals
[$₹][>9999999]##\,##\,##\,##0;[$₹][>99999]##\,##\,##0;[$₹]##,##0
C] For Lakhs and Crores without the Rupee symbol and with decimals
[>9999999]##\,##\,##\,##0.00;[>99999]##\,##\,##0.00;##,##0.00
D] For Lakhs and Crores without both the Rupee symbol and decimals
[>9999999]##\,##\,##\,##0;[>99999]##\,##\,##0;##,##0
Edit: I’ve tested these on both Google Sheets and Excel. Negative numbers work as well.