Celecoxib (CXB) is a COX-2-selective nonsteroidal anti-inflammatory drug used to control pain and various inflammatory conditions. CXB has limited oral bioavailability and a slow dissociation rate due to its poor water solubility. In order to enhance the oral bioavailability of CXB and reduce the frequency of administration, the present study was aimed at enhancing the aqueous solubility of CXB by a cosolvency technique and then at formulating and evaluating a CXB in situ floating gelling system for sustained oral delivery. Three cosolvents, namely, PEG 600, propylene glycol, and glycerin, at different concentrations, were used to solubilize CXB. Particle size analysis was performed to confirm the solubility of CXB in the solutions. The floating in situ gel formulations were then prepared by the incorporation of the CXB solution into sodium alginate solutions (0.25, 0.5, and 1% w/v). Formulations, in sol form, were then in vitro characterized for their physical appearance, pH, and rheological behaviors, while formulations in gel form were evaluated for their floating behavior and in vitro drug release studies. FTIR spectroscopy was performed to examine drug-polymer interaction. The selected formula was evaluated biologically for its anti-inflammatory and analgesic activities. Results revealed that the less-polar solvent PEG 600 at 80% v/v had the highest solubilization potential, and it was used to optimize the in situ gel formulation. The candidate formula (F3) was found to have the highest sodium alginate concentration (1% w/v) and showed the optimum sustained release profile with the Higuchi model release kinetics. The results from the FTIR spectroscopy analysis showed noticeable drug-polymer molecular interaction. Moreover, F3 exhibited a significantly higher percentage of paw edema inhibition at 8 h compared with the reference drug (p<0.05). Also, it showed a sustained duration of analgesia that persisted for the entire experimental time.