We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
I need advice re: excel formula please

If cell A1 has the word expense in it and if cell B1 shows a negative figure in it , say -112, I want the minus sign removed from cell B1 to just then show 112
Any help will be appreciated

Comments
-
In plain english
If A1 contains expense then B1 = ABS(B1)
You don't need to test for negative values if the A1 condition is met0 -
just multiply it by -10
-
I think it may need some VBA code actually. I haven't touched VBA for about 10 years0
-
If the result is to go into a third cell, say, C1, then it's easy...
=IF(LOWER(A1)="expenses",ABS(B1),B1)
I'd add LOWER so that any case matches.0 -
longforgotten wrote: »So what I want to do is this..........
If cell A1 has the word expense in it and if cell B1 shows a negative figure in it , say -112, I want the minus sign removed from cell B1 to just then show 112
Any help will be appreciated
Format values where this formula is true: =FIND("expense",A1)
Format: 0.00;0.00
Note this only alters the way the negative number is displayed, if you refer to the cell with another formula, its true value (if negative) will be used.
Also, it is case sensitive, you'd need a slightly more complex condition to get round that.
Why are expense items entered as negative anyway, or are they looked up from elsewhere?
If so, conditional formatting may not be the answer.I’m a Forum Ambassador and I support the Forum Team on the In My Home MoneySaving, Energy and Techie Stuff boards. If you need any help on these boards, do let me know. Please note that Ambassadors are not moderators. Any posts you spot in breach of the Forum Rules should be reported via the report button, or by emailing forumteam@moneysavingexpert.com.
All views are my own and not the official line of MoneySavingExpert.
0 -
Even with such a simple requirement, more info is required...0
-
Cornucopia wrote: »If the result is to go into a third cell, say, C1, then it's easy...
=IF(LOWER(A1)="expenses",ABS(B1),B1)
I'd add LOWER so that any case matches.
=IF(FIND("expenses",LOWER(A1))>0, ABS(B1),B1)
Deals with there being more than the word expenses in A10 -
Cornucopia wrote: »Even with such a simple requirement, more info is required...
The question needs expanding. In Excel thereare many ways to change cell b1depending on the contents of cell a1 but the best solution will be subject to the need/reason xuch as:
Do you wish to change just what is diplayed?
Do you use cell b1 in other calculations i.e. The actual value needs changing?
Is it just a one off cell change or will the test need repeating after a cell change/worksheet open/by user intervention?
Is the change for a single cell based upon that corresponding single cell or multiples of one or the other or both i.e. ranges of cells contiguous or otherwise.
I guess many of us like Corn. believe there is more to it than the outlined need otherwise you could just read cell a1 and change b1 manually!
It would help if you could add more to your original post as to what and why on how it will be used0 -
longforgotten hasn't been back to look at the replies thus far anyway...;)
I’m a Forum Ambassador and I support the Forum Team on the In My Home MoneySaving, Energy and Techie Stuff boards. If you need any help on these boards, do let me know. Please note that Ambassadors are not moderators. Any posts you spot in breach of the Forum Rules should be reported via the report button, or by emailing forumteam@moneysavingexpert.com.
All views are my own and not the official line of MoneySavingExpert.
0 -
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 350.7K Banking & Borrowing
- 253K Reduce Debt & Boost Income
- 453.4K Spending & Discounts
- 243.7K Work, Benefits & Business
- 598.5K Mortgages, Homes & Bills
- 176.8K Life & Family
- 256.9K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards