ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   I need a cell to equal have of what I put in (https://www.excelbanter.com/excel-worksheet-functions/137182-i-need-cell-equal-have-what-i-put.html)

LiLi

I need a cell to equal have of what I put in
 
how do I make a cell equal half of whatever $ amount I put in?
If I type in 23.50 (Accounting format) I want it to say $11.75

Gary''s Student

I need a cell to equal have of what I put in
 
You can scale either a single cell or a range of cells ( column, row,
whatever). In an unused cell enter
..5
and copy this cell. Then select the cells you want to adjust and
paste/special with multiply checked.
--
Gary's Student
gsnu200712


"lili" wrote:

how do I make a cell equal half of whatever $ amount I put in?
If I type in 23.50 (Accounting format) I want it to say $11.75


Teethless mama

I need a cell to equal have of what I put in
 
=A1/2

"lili" wrote:

how do I make a cell equal half of whatever $ amount I put in?
If I type in 23.50 (Accounting format) I want it to say $11.75


JE McGimpsey

I need a cell to equal have of what I put in
 
To do this automatically would require an event macro:

Put this in your worksheet code module (right-click the worksheet tab
and choose View Code):

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Const cdSCALE As Double = 0.5 'change to suit
With Target
If .Count = 1 Then
If .Address(False, False) = "E5" Then 'change E5 to suit
On Error Resume Next
Application.EnableEvents = False
.Value = Application.Round(.Value * cdSCALE, 2)
Application.EnableEvents = True
End If
End If
End With
End Sub

I used Round() since you're talking about currency. If you want
half-pennies, use

.Value = .Value * cdSCALE

instead.


Note that format of cells (other than Text) doesn't affect how inputs
are parsed or stored.

In article ,
lili wrote:

how do I make a cell equal half of whatever $ amount I put in?
If I type in 23.50 (Accounting format) I want it to say $11.75



All times are GMT +1. The time now is 04:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com