by: Abhinav Balaji, Darsan N S, Lokesh N, Sai Ganesh S and Thrivikraman S.

INTRODUCTION

Financial analysis plays a important role in evaluating a company’s performance, stability, and growth potential. By examining key financial metrics, analysts can identify risks, uncover trends, and support data-driven decision-making. This study focuses on critical aspects of financial analysis, including profitability ratios, liquidity ratios, and cash flow trends, to assess Tata Consultancy Services (TCS), a leading player in the IT sector.

TOPIC 1:Why we went for this topic

While sector analysis will provide a broad perspective, analyzing individual companies like Tata Consultancy Services (TCS) offers deeper insights into the details of the sector.

By focusing on TCS, we can:

Compare its financial performance with competitors (in this case Infosys)

Identify strengths and weaknesses in its Solvency, Profitability, and Liquidity.

Why the IT Industry?

The Information Technology (IT) sector is a driving force behind global economic growth, innovation, and digital transformation. Companies like TCS play an important role in the Industry.

QUESTION 2 - COMPETITOR ANALYSIS(using DuPont)

Infosys as a competitor

Infosys is a major competitor to TCS because both are leading IT service companies in India, offering similar solutions in software development, consulting, and digital transformation. They compete for global clients, major contracts, and top talent, making their rivalry significant in the tech industry. Since they operate in the same space, their financial performance, innovation, and market strategies are constantly compared.

Why DuPont?

DuPont analysis provides a detailed breakdown of Return on Equity (ROE), helping investors and analysts understand what truly drives a company’s profitability. Instead of looking at ROE as a single number, DuPont separates it into five key components:

ROE = (Tax Burden) × (Interest Burden) × (Operating Margin) × (Asset Turnover) × (Equity Multiplier)

DuPont Analysis For Infosys

Code by Thrivikraman S

library(dplyr)

library(readxl)
library(gridExtra)
library(ggplot2)
library(dplyr)

#-------------------------------------------------------------------------------

inf_pl<-read_excel("C:/Users/thriv/Downloads/xl/pl.xlsx")
inf_bs<-read_excel("C:/Users/thriv/Downloads/xl/bs.xlsx")
inf_cfs<-read_excel("C:/Users/thriv/Downloads/xl/cfs.xlsx")

inf_pl<-as.data.frame(inf_pl)
inf_bs<-as.data.frame(inf_bs)
inf_cfs<-as.data.frame(inf_cfs)

# Clean column names (if needed)
colnames(inf_pl) <- make.names(colnames(inf_pl))
colnames(inf_pl) <- trimws(colnames(inf_pl))

colnames(inf_bs) <- make.names(colnames(inf_bs))
colnames(inf_bs) <- trimws(colnames(inf_bs))
colnames(inf_cfs) <- make.names(colnames(inf_cfs))
colnames(inf_cfs) <- trimws(colnames(inf_cfs))
#-------------------------------------------------------------------------------
# Reshaping the data to long format using reshape function
inf_pl_long <- reshape(inf_pl, 
                       varying = c("X2024", "X2023", "X2022", "X2021", "X2020"), 
                       v.names = "Amount",
                       timevar = "Year",
                       times = c("2024","2023","2022","2021", "2020"),
                       direction = "long")

inf_bs_long<-reshape(inf_bs,
                     varying = c("X2024","X2023","X2022","X2021","X2020"),
                     v.names = "Amount",
                     timevar = "Year",
                     times = c("2024","2023","2022","2021","2020"),
                     direction = "long")
inf_cfs_long<-reshape(inf_cfs,
                      varying = c("X2024","X2023","X2022","X2021","X2020"),
                      v.names = "Amount",
                      timevar = "Year",
                      times = c("2024","2023","2022","2021","2020"),
                      direction = "long")

#-------------------------------------------------------------------------------
# Reset row names if necessary
rownames(inf_pl_long) <- NULL
rownames(inf_bs_long) <- NULL
rownames(inf_cfs_long) <- NULL
#objective- dupont analysis
#to compute- · ROE = Net Income/Average shareholders' equity 
#which is = Tax burden x Interest burden x EBIT margin x Asset turnover x Leverage

#necessary items for computation of ratios=
#EBT EBIT NETINCOME REVENUE AVGTOTALASSETS AVGSHAREHOLDEREQUITY 
#finding ebt




# Now, compute EBIT
#EBIT = REVENUE FROM OPERATIONS - OPERATING EXPENSES
Revenue <- inf_pl_long %>%
  filter(Items %in% c(
    "RevenueFromOperationsNet",  
    "OtherIncome"
  )) %>%
  group_by(Year) %>%
  summarise(Revenue = sum(Amount, na.rm = TRUE)) %>%
  arrange(Year) %>%
  pull(Revenue)


Total_Op_Expenses <- inf_pl_long %>%
  filter(Items %in% c(
    "CostOfMaterialsConsumed",
    "CostofPowerPurchased",
    "PurchaseOfStockInTrade",
    "CostOfFuel",
    "OperatingAndDirectExpenses",
    "ChangesInInventoriesOfFGWIPAndStockInTrade",
    "EmployeeBenefitExpenses",
    "DepreciationAndAmortisationExpenses",
    "OtherExpenses"
  )) %>%
  group_by(Year) %>%
  summarise(Total_Op_Expenses = sum(Amount)) %>%
  arrange(Year) %>%
  pull(Total_Op_Expenses)


# Now, compute EBIT
EBIT <- Revenue - Total_Op_Expenses

#now EBT

FC<- inf_pl_long %>%
  filter(Items == "FinanceCosts") %>%
  arrange(Year) %>%
  pull(Amount)
EBT<- (EBIT-FC)

#now Net income

Tax_expenses <- inf_pl_long %>%
  filter(Items %in% c("CurrentTax", "DeferredTax")) %>%
  group_by(Year) %>%
  summarise(Tax_Expenses = sum(Amount)) %>%
  pull(Tax_Expenses)


Net_income<- (EBT-Tax_expenses)
#calc taxburden

taxburden<-(Net_income/EBT)
#-------------------------------------------------------------------------------
#next calculate interest burden= EBT/EBIT
#EBT already retrieved 
#since EBIT is not directly given, EBIT = EBT+ FINANCE COSTS



intburd<- (EBT/EBIT)
#next calculate EBIT margin


#-------------------------------------------------------------------------------
#next EBIT margin

EBITmarg<- (EBIT/Revenue)
#-------------------------------------------------------------------------------

 #next calculate asset turnover ratio

# seperate ca and nca
non_current_assets <- c(
  "TangibleAssets", "IntangibleAssets", "CapitalWorkInProgress",
  "IntangibleAssetsUnderDevelopment", "FixedAssets", "NonCurrentInvestments",
  "DeferredTaxAssetsNet", "LongTermLoansAndAdvances", "OtherNonCurrentAssets"
)

current_assets <- c(
  "CurrentInvestments", "Inventories", "TradeReceivables",
  "CashAndCashEquivalents", "ShortTermLoansAndAdvances", "OtherCurrentAssets"
)#------------------------------------------------------------------------------

# Combine both categories into a single vector
assets <- c(non_current_assets, current_assets)

# Calculate total assets for each year
total_assets <- inf_bs_long %>%
  filter(Items %in% assets) %>%
  group_by(Year) %>%
  summarize(TotalAssets = sum(Amount, na.rm = TRUE))

# Calculate avg24
avg24 <- inf_bs_long %>%
  filter(Items %in% assets, Year %in% c(2023, 2024)) %>%
  summarize(TotalAssets = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalAssets) / 2  

# Calculate avg23
avg23 <- inf_bs_long %>%
  filter(Items %in% assets, Year %in% c(2022, 2023)) %>%
  summarize(TotalAssets = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalAssets) / 2  

# Calculate avg22 
avg22 <- inf_bs_long %>%
  filter(Items %in% assets, Year %in% c(2021, 2022)) %>%
  summarize(TotalAssets = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalAssets) / 2

# Calculate avg21 
avg21 <- inf_bs_long %>%
  filter(Items %in% assets, Year %in% c(2020, 2021)) %>%
  summarize(TotalAssets = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalAssets) / 2  

# Calculate avg20 
avg20 <- inf_bs_long %>%
  filter(Items %in% assets, Year == 2020) %>%
  summarize(TotalAssets = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalAssets)  # No division by 2 since it's only one year


ATA <- c(avg20, avg21, avg22, avg23, avg24)


Asturnover<- (Revenue/ATA)
#-------------------------------------------------------------------------------

#now calc of average shareholders equity

shareholders_equity_items <- c(
  "EquityShareCapital", "PreferenceShareCapital", "ReservesandSurplus",
  "EmployeesStockOptions", "MoneyReceivedAgainstShareWarrants"
)

# Calculate avg24
avg_eq_24 <- inf_bs_long %>%
  filter(Items %in% shareholders_equity_items, Year %in% c(2023, 2024)) %>%
  summarize(TotalEquity = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalEquity) / 2  

# Calculate avg23
avg_eq_23 <- inf_bs_long %>%
  filter(Items %in% shareholders_equity_items, Year %in% c(2022, 2023)) %>%
  summarize(TotalEquity = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalEquity) / 2  

# Calculate avg22 
avg_eq_22 <- inf_bs_long %>%
  filter(Items %in% shareholders_equity_items, Year %in% c(2021, 2022)) %>%
  summarize(TotalEquity = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalEquity) / 2

# Calculate avg21 
avg_eq_21 <- inf_bs_long %>%
  filter(Items %in% shareholders_equity_items, Year %in% c(2020, 2021)) %>%
  summarize(TotalEquity = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalEquity) / 2  

# Calculate avg20 
avg_eq_20 <- inf_bs_long %>%
  filter(Items %in% shareholders_equity_items, Year == 2020) %>%
  summarize(TotalEquity = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalEquity)

# Store in a vector
ASE <- c(avg_eq_20, avg_eq_21, avg_eq_22, avg_eq_23, avg_eq_24)

#now for the final ratio - leverage- avg total assets/ avg sh. equity
leverage<- (ATA/ASE) 


#now the final dupont calculation

DUPONT<- (taxburden*intburd*EBITmarg*Asturnover*leverage)
print(DUPONT)
## [1] 0.2497509 0.2698464 0.3015543 0.3395524 0.3657510

DuPont Analysis For TCS

Code By Sai Ganesh

library(readxl)
library(gridExtra)
library(ggplot2)
library(dplyr)
tcs_pl<-read_excel("C:/Users/thriv/Downloads/xl/tcs_pl.xlsx")
tcs_bs<-read_excel("C:/Users/thriv/Downloads/xl/tcs_bs.xlsx")
tcs_cfs<-read_excel("C:/Users/thriv/Downloads/xl/tcs_cfs.xlsx")

colnames(tcs_bs) <- make.names(colnames(tcs_bs))
colnames(tcs_pl) <- make.names(colnames(tcs_pl))
colnames(tcs_cfs) <- make.names(colnames(tcs_cfs))
colnames(tcs_bs) <- trimws(colnames(tcs_bs))
colnames(tcs_pl) <- trimws(colnames(tcs_pl))
colnames(tcs_cfs) <- trimws(colnames(tcs_cfs))
tcs_bs<-as.data.frame(tcs_bs)
tcs_pl<-as.data.frame(tcs_pl)
tcs_cfs<-as.data.frame(tcs_cfs)
tcs_bs_long <- reshape(tcs_bs, 
                       varying = c("X2024", "X2023", "X2022", "X2021", "X2020"), 
                       v.names = "Amount", 
                       timevar = "Year",
                       times = c("2024","2023","2022","2021", "2020"),
                       direction = "long")
tcs_pl_long <- reshape(tcs_pl, 
                       varying = c("X2024", "X2023", "X2022", "X2021", "X2020"), 
                       v.names = "Amount", 
                       timevar = "Year",
                       times = c("2024","2023","2022","2021", "2020"),
                       direction = "long")
tcs_cfs_long <- reshape(tcs_cfs, 
                        varying = c("X2024", "X2023", "X2022", "X2021", "X2020"), 
                        v.names = "Amount", 
                        timevar = "Year",
                        times = c("2024","2023","2022","2021", "2020"),
                        direction = "long")
rownames(tcs_bs_long) <- NULL
rownames(tcs_pl_long) <- NULL
rownames(tcs_cfs_long) <- NULL
tcs_cfs_long__clean <- na.omit(tcs_cfs_long)
#-------------------------------------------------------------------------------


Revenue_Tcs <- tcs_pl_long %>%
  filter(ITEMS %in% c(
    "REVENUE FROM OPERATION",
    "OTHER INCOME"
  )) %>%
  group_by(Year) %>%
  summarise(Revenue_Tcs = sum(Amount, na.rm = TRUE)) %>%
  arrange(Year) %>%
  pull(Revenue_Tcs)


Total_Op_Expenses_Tcs <- tcs_pl_long %>%
  filter(ITEMS %in% c("COST OF MAT CONSUMED","COST OF POWER PURCHASED",
                      "PURCHASE OF STOCK IN TRADE",
                      "COST OF FUEL",
                      "OPERTING AND DIRECT EXPENSES",
                      "CHANGES IN INVENTORY",
                      "EMPLOYEE BENEFIT COST",
                      "FINANCE COST",
                      "PROVISION AND CONTGENT",
                      "DEP AND AMORT",
                      "OTHER EXP")) %>%
  group_by(Year) %>%
  summarise(Total_Op_Expenses = sum(Amount)) %>%
  arrange(Year) %>%
  pull(Total_Op_Expenses)
#-------------------------------------------------------------------------------
EBIT_Tcs <- Revenue_Tcs - Total_Op_Expenses_Tcs

FIN_COST_Tcs <- tcs_pl_long %>%
  filter(ITEMS == "FINANCE COST") %>%
  arrange(Year) %>%
  pull(Amount)

EBT_Tcs <- (EBIT_Tcs - FIN_COST_Tcs)

Tax_expenses_Tcs <- tcs_pl_long %>%
  filter(ITEMS %in% c("CURRENT TAX", "DEFERRED TAX")) %>%
  group_by(Year) %>%
  summarise(Tax_Expenses = sum(Amount)) %>%
  pull(Tax_Expenses)

Net_income_Tcs <- (EBT_Tcs - Tax_expenses_Tcs)
#-------------------------------------------------------------------------------
taxburden_Tcs <- (Net_income_Tcs / EBT_Tcs)


INT_BURDEN_Tcs <- (EBT_Tcs / EBIT_Tcs)


EBIT_MARGIN_Tcs <- (EBIT_Tcs / Revenue_Tcs)
#-------------------------------------------------------------------------------
Non_Current_Assets_Tcs <- c("TangibleAssets", "IntangibleAssets",
                            "CapitalWorkInProgress",
                            "IntangibleAssetsundreDevelopment",
                            "OtherAssets",
                            "FixedAssets",
                            "NonCurrentInvestments")

Current_assets_Tcs <- c(
  "CurrentInvestments",
  "Inventories",
  "TradeReceivables",
  "CashAndCashEquivalents",
  "ShortTermLoansAndAdvances",
  "OtherCurrentAssets")

Assets_Tcs <- c(Non_Current_Assets_Tcs, Current_assets_Tcs)

Total_assets_Tcs <- tcs_bs_long %>%
  filter(X. %in% Assets_Tcs) %>%
  group_by(Year) %>%
  summarize(Total_assets = sum(Amount, na.rm = TRUE))
#-------------------------------------------------------------------------------
avg_24_Tcs <- tcs_bs_long %>%
  filter(X. %in% Assets_Tcs, Year %in% c(2023, 2024)) %>%
  summarize(TotalAssets = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalAssets) / 2

avg_23_Tcs <- tcs_bs_long %>%
  filter(X. %in% Assets_Tcs, Year %in% c(2022, 2023)) %>%
  summarize(TotalAssets = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalAssets) / 2  

avg_22_Tcs <- tcs_bs_long %>%
  filter(X. %in% Assets_Tcs, Year %in% c(2021, 2022)) %>%
  summarize(TotalAssets = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalAssets) / 2  

avg_21_Tcs <- tcs_bs_long %>%
  filter(X. %in% Assets_Tcs, Year %in% c(2020, 2021)) %>%
  summarize(TotalAssets = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalAssets) / 2  

avg_20_Tcs <- tcs_bs_long %>%
  filter(X. %in% Assets_Tcs, Year %in% c(2020)) %>%
  summarize(TotalAssets = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalAssets)

AVE_TOT_ASSET_Tcs <- c(avg_20_Tcs, avg_21_Tcs, avg_22_Tcs, avg_23_Tcs, avg_24_Tcs)
ASS_TURNOVER_RATIO_Tcs <- (Revenue_Tcs / AVE_TOT_ASSET_Tcs)

Shareholders_Equity_Tcs <- c(
  "EquityShareCapital",
  "PreferenceShareCapital",
  "RevaluationReserve",
  "ReservesandSurplus",
  "EmployeesStockOptions",
  "MoneyReceivedAgainstShareWarrants")

Avg_equity_24_Tcs <- tcs_bs_long %>%
  filter(X. %in% Shareholders_Equity_Tcs, Year %in% c(2023, 2024)) %>%
  summarize(TotalEquity = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalEquity) / 2

Avg_eq_23_Tcs <- tcs_bs_long %>%
  filter(X. %in% Shareholders_Equity_Tcs, Year %in% c(2022, 2023)) %>%
  summarize(TotalEquity = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalEquity) / 2

Avg_eq_22_Tcs <- tcs_bs_long %>%
  filter(X. %in% Shareholders_Equity_Tcs, Year %in% c(2021, 2022)) %>%
  summarize(TotalEquity = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalEquity) / 2

Avg_eq_21_Tcs <- tcs_bs_long %>%
  filter(X. %in% Shareholders_Equity_Tcs, Year %in% c(2020, 2021)) %>%
  summarize(TotalEquity = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalEquity) / 2

Avg_eq_20_Tcs <- tcs_bs_long %>%
  filter(X. %in% Shareholders_Equity_Tcs, Year %in% c(2020)) %>%
  summarize(TotalEquity = sum(Amount, na.rm = TRUE)) %>%
  pull(TotalEquity)

AVG_SH_EQ_Tcs <- c(Avg_eq_20_Tcs, Avg_eq_21_Tcs, Avg_eq_22_Tcs, Avg_eq_23_Tcs, Avg_equity_24_Tcs)

leverage_Tcs <- (AVE_TOT_ASSET_Tcs / AVG_SH_EQ_Tcs)

DUPONT_Tcs <- (taxburden_Tcs * INT_BURDEN_Tcs * EBIT_MARGIN_Tcs * ASS_TURNOVER_RATIO_Tcs * leverage_Tcs)

print(DUPONT_Tcs)
## [1] 0.1206702 0.1307706 0.1407542 0.1521841 0.1698919

Plot For DuPont Analysis

Code by Thrivikraman

dupont_data <- data.frame(
  Year = rep(2020:2024, 2),
  ROE = c(DUPONT, DUPONT_Tcs),
  Company = rep(c("Infosys", "TCS"), each = 5)
)

# Plot
ggplot(dupont_data, aes(x = Year)) +
  geom_line(data = subset(dupont_data, Company == "Infosys"), 
            aes(y = ROE), 
            col = "red",
            linewidth = 2) +
  geom_point(data = subset(dupont_data, Company == "Infosys"), 
             aes(y = ROE), 
             col = "blue", 
             size = 5) +
  geom_line(data = subset(dupont_data, Company == "TCS"), 
            aes(y = ROE), 
            col = "blue",
            linewidth = 2) +
  geom_point(data = subset(dupont_data, Company == "TCS"), 
             aes(y = ROE), 
             col = "red", 
             size = 5) +
  labs(x = "Year", y = "ROE (%)",
       title = "DuPont ROE Comparison",
       subtitle = "Infosys vs TCS (2020-2024)") +
  scale_y_continuous(labels = scales::percent_format(accuracy = 1)) +
  theme_minimal()

The given data represents the ROE values for Infosys and TCS over five years.

Observations

Infosys has a consistently higher ROE than TCS. Infosys’s ROE increased from 25% to 36.6%, indicating improving profitability and efficiency. TCS’s ROE also improved but at a slower rate, moving from 12.1% to 17% over the same period.

Interpretation

Infosys’ consistently higher ROE compared to TCS is primarily driven by its superior net profit margin, indicating stronger cost efficiency and profitability. While asset turnover and financial leverage may also contribute, the dominant factor appears to be profitability. On the other hand, TCS, despite showing improvement, maintains a more conservative ROE, likely due to lower net profit margins or strategic decisions favoring stability over aggressive expansion. TCS is efficient in using assets (high asset turnover), but profitability is weaker (lower profit margins). Infosys compensates for lower asset turnover with significantly higher profitability.

QUESTION 3 - RATIO ANALYSIS

SOLVENCY RATIOS

Solvency ratios assess a company’s long-term financial stability and capacity to meet debt obligations. Metrics like debt-to-equity (D/E), Debt ratio and Equity ratio evaluate reliance on borrowed funds and capacity of funds brought in by the owners. The solvency ratios play a crucial role in determining the long term financial decisions of the company.

Code By Darsan N S

#Calculate Debt-Equity Ratio
#Formula - Total Liabilities/Total Equity
#-------------------------------------------------------------------------------

#Calculating Total Liabilities
total_liab <- tcs_bs_long %>%
  filter(X. %in% c("LongTermBorrowings",
                   "DeferredTaxLiabilitiesNet",
                   "OtherLongTermLiabilities",
                   "TradePayables",
                   "OtherCurrentLiabilities",
                   "ShortTermProvisions" )) %>%
  group_by(Year) %>%
  summarise(total_liab = sum(Amount)) %>%
  arrange(Year) %>%
  pull(total_liab)
#-------------------------------------------------------------------------------

#Calculating Total Equity
total_equity <- tcs_bs_long %>%
  filter(X. %in% c( "EquityShareCapital",
                    "ReservesandSurplus")) %>%
  group_by(Year) %>%
  summarise(total_equity = sum(Amount)) %>%
  arrange(Year) %>%
  pull(total_equity)
#-------------------------------------------------------------------------------

#Calculating Debt-Equity Ratio

debt_equity_ratio<- total_liab/total_equity
#-------------------------------------------------------------------------------
# Create a dataframe with debt_equity_ratio
debt_equity_df <- data.frame(Year = c(2020, 2021, 2022, 2023, 2024),  
                             Debt_Equity_Ratio = debt_equity_ratio)

# Plot the Debt-Equity Ratio

ggplot(debt_equity_df, aes(x = Year, y = Debt_Equity_Ratio)) +
  geom_line(color = "blue", size = 1) +  # Line plot
  geom_point(color = "red", size = 3) +  # Points on the line
  scale_x_continuous(breaks = c(2020, 2021, 2022, 2023, 2024)) +  # Ensure correct year labels
  labs(title = "Debt-Equity Ratio Over the Years",
       x = "Year",
       y = "Debt-Equity Ratio") +
  theme(
    plot.title = element_text(hjust = 0.5, face = "bold", size = 14),
    axis.title.x = element_text(face = "bold", size = 12),
    axis.title.y = element_text(face = "bold", size = 12),
    axis.text = element_text(size = 10),
    panel.background = element_rect(fill = "white", color = "black"),  # Adds a border
    panel.grid.major = element_line(color = "gray", linetype = "dashed"),
    panel.grid.minor = element_blank()
  )

#-------------------------------------------------------------------------------
#Calculating Debt Ratio
#Formula = Total Liabilities/Total Assets
#-------------------------------------------------------------------------------

#Calculating Total Assets
total_asset <- total_equity + total_liab
#-------------------------------------------------------------------------------
#Calculating Debt Ratio
debt_ratio<-total_liab/total_asset
#-------------------------------------------------------------------------------
# Create a dataframe with debt_ratio
debt_ratio_df <- data.frame(Year = c(2020, 2021, 2022, 2023, 2024),  
                            Debt_Ratio = debt_ratio)

# Plot the Debt-Equity Ratio

ggplot(debt_ratio_df, aes(x = Year, y = Debt_Ratio)) +
  geom_line(color = "blue", size = 1) +  # Line plot
  geom_point(color = "red", size = 3) +  # Points on the line
  scale_x_continuous(breaks = c(2020, 2021, 2022, 2023, 2024)) +
  labs(title = "Debt Ratio Over the Years",
       x = "Year",
       y = "Debt Ratio") +
  theme(
    plot.title = element_text(hjust = 0.5, face = "bold", size = 14),
    axis.title.x = element_text(face = "bold", size = 12),
    axis.title.y = element_text(face = "bold", size = 12),
    axis.text = element_text(size = 10),
    panel.background = element_rect(fill = "white", color = "black"),  
    panel.grid.major = element_line(color = "gray", linetype = "dashed"),
    panel.grid.minor = element_blank()
  )

#-------------------------------------------------------------------------------
#Calculating Equity Ratio
#Formula = Total Equity/Total Asset

equity_ratio<-total_equity/total_asset
#-------------------------------------------------------------------------------
#Create a dataframe with equity_ratio
equity_ratio_df <- data.frame(Year = c(2020, 2021, 2022, 2023, 2024),  
                              Equity_Ratio = equity_ratio)


# Plot the Equity Ratio

ggplot(equity_ratio_df, aes(x = Year, y = Equity_Ratio)) +
  geom_line(color = "blue", size = 1) +  # Line plot
  geom_point(color = "red", size = 3) +  # Points on the line
  scale_x_continuous(breaks = c(2020, 2021, 2022, 2023, 2024)) +
  labs(title = "Equity Ratio Over the Years",
       x = "Year",
       y = "Equity Ratio") +
  theme(
    plot.title = element_text(hjust = 0.5, face = "bold", size = 14),
    axis.title.x = element_text(face = "bold", size = 12),
    axis.title.y = element_text(face = "bold", size = 12),
    axis.text = element_text(size = 10),
    panel.background = element_rect(fill = "white", color = "black"),  
    panel.grid.major = element_line(color = "gray", linetype = "dashed"),
    panel.grid.minor = element_blank()
  )

STRENGTHS:

Strong Equity Base: Although the equity ratio is declining, it still suggests that the company is primarily funded through shareholders’ equity (as seen by the company’s no debt policy), which indicates a relatively lower financial risk.

Increased Trade Payables Induces Confidence on the Company: The increase in trade payables suggests that suppliers and vendors have confidence in TCS’s ability to meet its obligations. This form of short-term financing allows the company to conserve cash for operational or investment purposes.

WEAKNESS:

Rising Debt and Decreasing Equity Ratio: The debt-equity ratio has increased from 0.4 to 0.6, and the equity ratio has dropped from 0.7 to 0.5. This signals that the company is relying more on external liabilities (trade payables and other short-term debts) to fund its operations, which could weaken financial stability in the long term.

Potential Under-utilization of Leverage: While a debt-free structure reduces risk, it may also suggest that TCS is not fully utilizing debt financing opportunities that could potentially enhance shareholder returns.

LIQUIDITY RATIOS

Liquidity ratios determine a company’s ability to cover short-term liabilities with liquid assets. The current ratio and cash ratio measure liquidity. High liquidity ensures operational smoothness, but excessively high ratios may indicate idle cash that could be reinvested.

Code BY Abhinav Balaji

#Current Ratio
#Formula= "Current Assets/Current Liabilities"

#Calculating Current Assets--------------------------------

Current_Assets <- tcs_bs_long %>%
  filter(X. %in% c("CurrentInvestments", 
                   "Inventories", 
                   "TradeReceivables", 
                   "CashAndCashEquivalents", 
                   "ShortTermLoansAndAdvances", 
                   "OtherCurrentAssets")) %>%
  group_by(Year) %>%  # Group by Year to get a sum for each year
  summarise(Current_Assets = sum(Amount, na.rm = TRUE)) %>%  # Summing the 'Amount' for current assets
  arrange(Year) %>%  # Arranging by Year
  pull(Current_Assets)  # Extracting the result as a vector of Current Assets for each year

#Calculating Current Liabilities----------------------------

Current_Liabilities <- tcs_bs_long %>%
  filter(X. %in% c("ShortTermBorrowings", 
                   "TradePayables", 
                   "OtherCurrentLiabilities", 
                   "ShortTermProvisions")) %>%
  group_by(Year) %>%  # Group by Year to get a sum for each year
  summarise(Current_Liabilities = sum(Amount, na.rm = TRUE)) %>%  # Summing the 'Amount' for current liabilities
  arrange(Year) %>%  # Arranging by Year
  pull(Current_Liabilities)  # Extracting the result as a vector of Current Assets for each year

#-------------------------------------Calculating Current Ratio-------------------------------------

Current_ratio<- Current_Assets/Current_Liabilities


#Create a dataframe with Current_Ratio------------------------------

Current_Ratio_df <- data.frame(Year = c(2020, 2021, 2022, 2023, 2024),  
                               Current_Ratio = Current_ratio)

#Plotting Current_Ratio--------------------------------------------------

ggplot(Current_Ratio_df, aes(x = Year, y = Current_Ratio)) +
  geom_line(color = "blue", size = 1) +  # Line plot
  geom_point(color = "red", size = 3) +  # Points on the line
  scale_x_continuous(breaks = c(2020, 2021, 2022, 2023, 2024)) +  # Ensure correct year labels
  labs(title = "Current Ratio Over the Years",
       x = "Year",
       y = "Current Ratio") +
  theme(
    plot.title = element_text(hjust = 0.5, face = "bold", size = 14),
    axis.title.x = element_text(face = "bold", size = 12),
    axis.title.y = element_text(face = "bold", size = 12),
    axis.text = element_text(size = 10),
    panel.background = element_rect(fill = "white", color = "black"),  # Adds a border
    panel.grid.major = element_line(color = "gray", linetype = "dashed"),
    panel.grid.minor = element_blank())

#------------------------------------------------------------------------------------------------------------

#Cash Ratio
#Formula = "Cash and Cash Equivalents/Current Liabilities"; 
#Calculating cash and cash equivalents----------------------------------

Cash_And_Cash_Equivalents <- tcs_bs_long %>%
  filter(X. %in% c("CashAndCashEquivalents", "CashAndCashEquivalents_Other")) %>%
  group_by(Year) %>%  # Group by Year to get a sum for each year
  summarise(Cash_And_Cash_Equivalents = sum(Amount, na.rm = TRUE)) %>%  # Summing the 'Amount' for cash
  arrange(Year) %>%  # Arranging by Year
  pull(Cash_And_Cash_Equivalents)  # Extracting the result as a vector of cash and cash equivalents

#Calculating current liabilities----------------------------------------

Current_Liabilities <- tcs_bs_long %>%
  filter(X. %in% c("ShortTermBorrowings", 
                   "TradePayables", 
                   "OtherCurrentLiabilities", 
                   "ShortTermProvisions")) %>%
  group_by(Year) %>%  # Group by Year to get a sum for each year
  summarise(Current_Liabilities = sum(Amount, na.rm = TRUE)) %>%  # Summing the 'Amount' for current liabilities
  arrange(Year) %>%  # Arranging by Year
  pull(Current_Liabilities)  # Extracting the result as a vector of Current Liabilities for each year

#-------------------------------------Calculating cash Ratio--------------------------------------------
#Cash Ratio
#Formula = "Cash and Cash Equivalents/Current Liabilities"; 

#Calculating cash and cash equivalents----------------------------------

Cash_And_Cash_Equivalents <- tcs_bs_long %>%
  filter(X. %in% c("CashAndCashEquivalents", "CashAndCashEquivalents_Other")) %>%
  group_by(Year) %>%  # Group by Year to get a sum for each year
  summarise(Cash_And_Cash_Equivalents = sum(Amount, na.rm = TRUE)) %>%  # Summing the 'Amount' for cash
  arrange(Year) %>%  # Arranging by Year
  pull(Cash_And_Cash_Equivalents)  # Extracting the result as a vector of cash and cash equivalents

#Calculating current liabilities----------------------------------------

Current_Liabilities <- tcs_bs_long %>%
  filter(X. %in% c("ShortTermBorrowings", 
                   "TradePayables", 
                   "OtherCurrentLiabilities", 
                   "ShortTermProvisions")) %>%
  group_by(Year) %>%  # Group by Year to get a sum for each year
  summarise(Current_Liabilities = sum(Amount, na.rm = TRUE)) %>%  # Summing the 'Amount' for current liabilities
  arrange(Year) %>%  # Arranging by Year
  pull(Current_Liabilities)  # Extracting the result as a vector of Current Liabilities for each year

#-------------------------------------Calculating cash Ratio--------------------------------------------
#Cash Ratio
#Formula = "Cash and Cash Equivalents/Current Liabilities"; 

#Calculating cash and cash equivalents----------------------------------

Cash_And_Cash_Equivalents <- tcs_bs_long %>%
  filter(X. %in% c("CashAndCashEquivalents", "CashAndCashEquivalents_Other")) %>%
  group_by(Year) %>%  # Group by Year to get a sum for each year
  summarise(Cash_And_Cash_Equivalents = sum(Amount, na.rm = TRUE)) %>%  # Summing the 'Amount' for cash
  arrange(Year) %>%  # Arranging by Year
  pull(Cash_And_Cash_Equivalents)  # Extracting the result as a vector of cash and cash equivalents


#-------------------------------------Calculating cash Ratio--------------------------------------------

Cash_Ratio <- (Cash_And_Cash_Equivalents / Current_Liabilities)

Cash_Ratio_df <- data.frame(Year = c(2020, 2021, 2022, 2023, 2024),  
                               Cash_Ratio = Cash_Ratio)

# Plotting the Cash Ratio --------------------------------------------

ggplot(Cash_Ratio_df, aes(x = Year, y = Cash_Ratio)) +
  geom_line(color = "blue", size = 1) +  # Line plot
  geom_point(color = "green", size = 3) +  # Points on the line
  scale_x_continuous(breaks = unique(Cash_Ratio_df$Year)) +  # Ensure correct year labels
  labs(title = "Cash Ratio Over the Years",
       x = "Year",
       y = "Cash Ratio") +
  theme(
    plot.title = element_text(hjust = 0.5, face = "bold", size = 14),
    axis.title.x = element_text(face = "bold", size = 12),
    axis.title.y = element_text(face = "bold", size = 12),
    axis.text = element_text(size = 10),
    panel.background = element_rect(fill = "white", color = "black"),  # Adds a border
    panel.grid.major = element_line(color = "gray", linetype = "dashed"),
    panel.grid.minor = element_blank())

STRENGTHS :

  1. Still Above 1: Despite the decline, the current ratio remains above 2, indicating that TCS still has sufficient current assets to cover its current liabilities. This suggests a reasonable liquidity position.

  2. Efficient Use of Assets: The gradual decline could indicate that TCS might be utilizing its current assets more efficiently or reducing excess liquidity, which could enhance returns on assets.

WEAKNESSES :

  1. Declining Liquidity: The consistent decrease indicates a reduction in the company’s liquidity, which may signal rising liabilities or reduced current assets. This could increase financial risk.

  2. Potential Strain on Working Capital: A declining current ratio may reflect working capital challenges, making it harder for TCS to manage day-to-day operations effectively.

  3. Possible Increase in Short-Term Debt: The drop might also suggest that TCS has been increasing its short-term liabilities faster than its current assets, which could lead to potential cash flow issues.

PROFITABILITY RATIOS

Profitability ratios measure a company’s ability to generate earnings relative to sales, assets, and equity. Key metrics like gross profit margin and net profit margin reveal how efficiently a company converts revenue into profit. Strong profitability signals competitive advantage and sustainable growth, while weak ratios may indicate pricing pressure, high costs, or poor management.

Code By Lokesh N

#Calculate Gross Profit Margin
#Formula - Gross Profit/Revenue From 
COGS <- tcs_pl_long %>%
  filter(ITEMS %in% c("PURCHASE OF STOCK IN TRADE", 
                      "CHANGES IN INVENTORY",
                      "OPERTING AND DIRECT EXPENSES")) %>%
  group_by(Year) %>%
  summarise(COGS = sum(Amount, na.rm = TRUE)) %>%
  arrange(Year) %>%
  pull(COGS)

gross_profit_tcs<- (Revenue_Tcs-COGS)

#-------------------------------------------------------------------------------
gross_profit_margin<-(gross_profit_tcs/Revenue_Tcs)*100
gross_profit_margin<- data.frame(
  Year = 2020:2024,
  gross_profit_margin = gross_profit_margin
)
# Visualize the trend
library(ggplot2)
ggplot(gross_profit_margin, aes(x = Year, y = gross_profit_margin, group = 1)) +
  geom_line(color = "steelblue", linewidth = 1.2) +
  geom_point(size = 3, color = "darkblue") +
  labs(title = "TCS Gross Profit Margin ",
       subtitle = "2020-2024",
       y = "Gross Profit Margin (%)",
       x = "Year") +
  theme_minimal() +
  scale_y_continuous(labels = scales::percent_format(scale = 1))

#-------------------------------------------------------------------------------

net_profit_margin<-(Net_income_Tcs/Revenue_Tcs)*100

net_profit_margin<- data.frame(
  Year = 2020:2024,
  net_profit_margin = net_profit_margin
)

# Visualize the trend
library(ggplot2)
ggplot(net_profit_margin, aes(x = Year, y = net_profit_margin, group = 1)) +
  geom_line(color = "steelblue", linewidth = 1.2) +
  geom_point(size = 3, color = "darkblue") +
  labs(title = "TCS Net Profit Margin ",
       subtitle = "2020-2024",
       y = "Net Profit Margin (%)",
       x = "Year") +
  theme_minimal() +
  scale_y_continuous(labels = scales::percent_format(scale = 1))

STRENGTHS:

1.A steadily increasing gross profit margin suggests that the company has improved its revenue generation or reduced direct costs (like raw materials or labor costs).

This could indicate strong pricing power, effective cost control in production, or better sales performance.

2.Sudden Increase in Net Profit Margin in the Last Year:

This suggests that the company took corrective measures to improve its overall profitability.

Possible reasons could be cost-cutting efforts, increased operational efficiency, reduction in debts, or improved tax benefits.

WEAKNESSES:

1.Despite improving gross profit, net profit margin dropping indicates rising operational costs, interest expenses, taxes, or other indirect expenses.

This could suggest inefficiency in managing administrative expenses, increasing debt burden, or poor cost control beyond production.

2.Unstable Profitability:

A gradual decline in net profit margin followed by a sudden rise in the last year may indicate inconsistent financial management.

It suggests that the company might have been struggling to manage indirect costs until a significant change (such as restructuring or a one-time income) helped boost profits in the last year.