Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default convert +/- on text value

Hi ng
Using xl xp pro

Need to "flip" sign on value in column c if adjacent cell in col b
4199 TOTAL SALES AND REVENUES or
7110 TOTAL OPERATING PROFIT CONTRIBUTION

Value begin row 3
End row is unknown.
Can someone push me in the right direction?

tia
goss
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default convert +/- on text value

Goss,
if I understand you correctly..

make a range of those accountnumbers you want flipped.
name that range: flipped

then use this will give you the flipped amount of c
=C3*(2*ISERROR(MATCH(A3,flipped,0))-1)

just copy it down and hide the original column 3


cheerz!

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


(gossamer) wrote:

Hi ng
Using xl xp pro

Need to "flip" sign on value in column c if adjacent cell in col b
4199 TOTAL SALES AND REVENUES or
7110 TOTAL OPERATING PROFIT CONTRIBUTION

Value begin row 3
End row is unknown.
Can someone push me in the right direction?

tia
goss


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default convert +/- on text value

Thanks "cool"
Not quite it.
Want to change from neg to pos or pos it neg if either
condition is met. Namely, val in col b = "Sales" or "OPC"
Then convert neg/pos on adjacent cell col c
Otherwise leave value in col c intact

Ex:
=================================================
Begin Data-
A B C
1 Sales 90500

End Data-
A B C
1 Sales -90500
=================================================

"Sales" encountered in col b so adjacent cell col c, converted to neg

Prefer VBA if possbile so store in "personal.xls" in xlstart
This code would have multiple applications for me.

"keepitcool" wrote in message
...
Goss,
if I understand you correctly..

make a range of those accountnumbers you want flipped.
name that range: flipped

then use this will give you the flipped amount of c
=C3*(2*ISERROR(MATCH(A3,flipped,0))-1)

just copy it down and hide the original column 3


cheerz!

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


(gossamer) wrote:

Hi ng
Using xl xp pro

Need to "flip" sign on value in column c if adjacent cell in col b
4199 TOTAL SALES AND REVENUES or
7110 TOTAL OPERATING PROFIT CONTRIBUTION

Value begin row 3
End row is unknown.
Can someone push me in the right direction?

tia
goss




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default convert +/- on text value

OH!!...

if you had been more specific in the first place
then both of use would have been done sooner!

Swap commant marker if you want values,
as is this will keep formulas


Option Explicit
Sub Flip()
Dim c As Range, cFirst As String, s As Variant, lCalc As Long
With Application
lCalc = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
For Each s In Array( _
"sales and revenues", _
"operating profit")

With Range("b:b")
Set c = .Find(s, , xlValues, xlPart, xlByColumns, xlNext, False)
If Not c Is Nothing Then
cFirst = c.Address
Do
With c(1, 2)
If .Formula < "" Then
.Formula = "=-1*" & Mid(.Formula, InStr(.Formula, "=") + 1)
'.Formula = -1 * .Value
End If
End With
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < cFirst
End If
End With
Next s
With Application
.ScreenUpdating = True
.Calculation = lCalc
End With
End Sub


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"goss" wrote:

Thanks "cool"
Not quite it.
Want to change from neg to pos or pos it neg if either
condition is met. Namely, val in col b = "Sales" or "OPC"
Then convert neg/pos on adjacent cell col c
Otherwise leave value in col c intact

Ex:
=================================================
Begin Data-
A B C
1 Sales 90500

End Data-
A B C
1 Sales -90500
=================================================

"Sales" encountered in col b so adjacent cell col c, converted to neg

Prefer VBA if possbile so store in "personal.xls" in xlstart
This code would have multiple applications for me.

"keepitcool" wrote in message
...
Goss,
if I understand you correctly..

make a range of those accountnumbers you want flipped.
name that range: flipped

then use this will give you the flipped amount of c
=C3*(2*ISERROR(MATCH(A3,flipped,0))-1)

just copy it down and hide the original column 3


cheerz!

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


(gossamer) wrote:

Hi ng
Using xl xp pro

Need to "flip" sign on value in column c if adjacent cell in col b
4199 TOTAL SALES AND REVENUES or
7110 TOTAL OPERATING PROFIT CONTRIBUTION

Value begin row 3
End row is unknown.
Can someone push me in the right direction?

tia
goss






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert to text MAX Excel Worksheet Functions 1 August 17th 09 12:24 AM
How do i convert diagonal text into horizontal text Alexander Excel Worksheet Functions 0 July 15th 08 07:02 PM
How do I convert a text array to a concatenated text cell? Excel. Vargasjc Excel Worksheet Functions 5 December 20th 06 06:35 PM
how to convert text to value Sally Excel Worksheet Functions 1 July 26th 05 02:43 PM
convert a range of lowercase text to upper text or vice versa jackdaw Excel Worksheet Functions 2 May 16th 05 09:31 PM


All times are GMT +1. The time now is 08:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"