[Solved] Conditional Formatting, Macro, VBA, IF !??!

Discuss the spreadsheet application
Post Reply
safetydave
Posts: 4
Joined: Tue Oct 22, 2019 11:43 pm

[Solved] Conditional Formatting, Macro, VBA, IF !??!

Post by safetydave »

I have a spreadsheet with a simple calculation that I cannot figure out, sorry in advance.

Column a1 - Materials At Cost Say it is = 100.00
Column D1 - Actual cost(expenses) = 0.
Column E1 = Difference (between A1 and D1) = 100

However, I do not want to show any value in E1 until there are expenses entered into D1.

So how do I achieve that?
Last edited by Hagar Delest on Thu Oct 24, 2019 4:49 pm, edited 1 time in total.
Reason: tagged solved.
Dave P
Open OFfice 16, Windows 10 Pro 64 Bit
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Conditional Formatting, Macro, VBA, IF !??! Help

Post by RusselB »

Welcome to the Forums.
This is, simply, a formula matter. Nothing to do with Conditional formatting or macros.
In E1 enter the formula

Code: Select all

=if(D1=0;"";A1-D1)
Off topic, please use the User Control Panel, click the Profile tab, then Edit Signature...and change your forum signature to reflect what you are actually using.
OpenOffice 16 has not been released yet. The current version is 4.1.7
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
safetydave
Posts: 4
Joined: Tue Oct 22, 2019 11:43 pm

Re: Conditional Formatting, Macro, VBA, IF !??! Help

Post by safetydave »

Sorry copied and did not work, gave an error for "problem with this formula. asked me to put an apostrophe first (') but that didn't ended in just showing the entire formula.
Dave P
Open OFfice 16, Windows 10 Pro 64 Bit
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Conditional Formatting, Macro, VBA, IF !??! Help

Post by RusselB »

Try using the Select All link above the code, or just enter the code manually as I posted it.
Putting the ' in front will make it act as text, not a formula.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
User avatar
Zizi64
Volunteer
Posts: 11362
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Conditional Formatting, Macro, VBA, IF !??! Help

Post by Zizi64 »

Sorry copied and did not work, gave an error for "problem with this formula. asked me to put an apostrophe first (') but that didn't ended in just showing the entire formula.
Please upload your sample fle here.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Bill
Volunteer
Posts: 8934
Joined: Sat Nov 24, 2007 6:48 am

Re: Conditional Formatting, Macro, VBA, IF !??! Help

Post by Bill »

safetydave wrote:Sorry copied and did not work, gave an error for "problem with this formula. asked me to put an apostrophe first (') but that didn't ended in just showing the entire formula.
I can't duplicate the error. When I copied the formula, it worked perfectly.

Are you seeing this error in MS Excel 2016? A search for "problem with this formula" returned examples of problems in Excel, not in AOO Calc.
AOO 4.1.14 on Ubuntu MATE 22.04
safetydave
Posts: 4
Joined: Tue Oct 22, 2019 11:43 pm

Re: Conditional Formatting, Macro, VBA, IF !??! Help

Post by safetydave »

Other than changing the cells in the formula from A1, D1 etc- Due to the header line info, changed the cells in formula to 2's and I couldn't get it to work. Sorry,
Attachments
Book1.xlsx
(11.83 KiB) Downloaded 88 times
Dave P
Open OFfice 16, Windows 10 Pro 64 Bit
User avatar
Zizi64
Volunteer
Posts: 11362
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Conditional Formatting, Macro, VBA, IF !??! Help

Post by Zizi64 »

You are using some exotic (localized) quotation mark characters ”” instead of the pure (typewriter-type) quotation marks "".
Your formulas works for me with the "" marks.
Book1.ods
(12.32 KiB) Downloaded 79 times
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
Posts: 11362
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Conditional Formatting, Macro, VBA, IF !??! Help

Post by Zizi64 »


Book1.xlsx
(11.83 KiB) Downloaded 1 time
___________________________________________
Dave P
Open OFfice 16, Windows 10 Pro 64 Bit

If you can save your document into .xlsx format, then you are using LibreOffice or Excel, but not OpenOffice.
The Apache OpenOffice can not save into .xlsx format. The recent AOO version is the AOO 4.1.7.
Please update your signature.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
safetydave
Posts: 4
Joined: Tue Oct 22, 2019 11:43 pm

Re: Conditional Formatting, Macro, VBA, IF !??! Help

Post by safetydave »

Not sure why, but I walked away, came back struck my computer with a simple glancing blow with an eraser and voila.... entered the formula again and it worked. Thanks so much!!!!!!! :D :D :D :D :D :D
Dave P
Open OFfice 16, Windows 10 Pro 64 Bit
Post Reply