[Solved] #NAME? error when using column label

Discuss the spreadsheet application
Post Reply
prabharathi
Posts: 11
Joined: Fri Dec 08, 2017 4:37 pm

[Solved] #NAME? error when using column label

Post by prabharathi »

I have a spreadsheet where I want to know the balance after entering the daily profit and loss in trading.
A column has date, B column has the title Profit, C column has the title Loss, D column has the Balance
I enter the formula in D4 as =IF('Profit';D3+B4;D3-C4) but it returns an error while it works with my bank sheets where the Profit and loss are replaced with Credit and Debit. Am I missing anything?

 Edit: Changed subject, was Problems with IF function in Calc 
Make your post understandable by others 
-- MrProgrammer, forum moderator 
Attachments
oooforum1.jpg
oooforum1.jpg (71.1 KiB) Viewed 3370 times
oooforum2.jpg
oooforum2.jpg (70.09 KiB) Viewed 3370 times
Last edited by Hagar Delest on Sat Jul 13, 2024 3:13 pm, edited 2 times in total.
Reason: tagged solved.
Open Office 4.1.4 on Windows 10
FJCC
Moderator
Posts: 9647
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Problems with IF function in calc

Post by FJCC »

You can get the behavior you want by going to Tools -> Options, expanding the Calc list on the left, selecting Calculate, and selecting "Automatically find column and row labels".
If the cells that look empty in your image are really empty, you could use the formula

Code: Select all

=D2+B3-C3
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
prabharathi
Posts: 11
Joined: Fri Dec 08, 2017 4:37 pm

Re: Problems with IF function in calc

Post by prabharathi »

FJCC wrote: ↑Fri Jul 12, 2024 3:03 pm You can get the behavior you want by going to Tools -> Options, expanding the Calc list on the left, selecting Calculate, and selecting "Automatically find column and row labels".
If the cells that look empty in your image are really empty, you could use the formula

Code: Select all

=D2+B3-C3
Thank you very much for the reply and help. I just checked and the box for automatically find the column and row labels was ticked on.
Hence I used the formula and it is what I wanted.
Attachments
ooforum3.jpg
ooforum3.jpg (61.86 KiB) Viewed 3343 times
Open Office 4.1.4 on Windows 10
prabharathi
Posts: 11
Joined: Fri Dec 08, 2017 4:37 pm

Re: Problems with IF function in calc

Post by prabharathi »

FJCC wrote: ↑Fri Jul 12, 2024 3:03 pm You can get the behavior you want by going to Tools -> Options, expanding the Calc list on the left, selecting Calculate, and selecting "Automatically find column and row labels".
If the cells that look empty in your image are really empty, you could use the formula

Code: Select all

=D2+B3-C3
Finally solved it in another way. Instead of writing profit in the IF function I wrote Loss and made necessary swap in the calculation of cells. It worked. I have enclosed the screen shot where the D column has the formula suggested by you and E column has the IF function.
Attachments
oooforum4.jpg
oooforum4.jpg (69.96 KiB) Viewed 3326 times
Open Office 4.1.4 on Windows 10
User avatar
keme
Volunteer
Posts: 3799
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Problems with IF function in Calc

Post by keme »

The workaround is fine, but you may still want to use the column headers instead, for formula legibility.

The formula error suggests that the field name (column header) is wrong. The usual cause is a trailing space.
If you correct the column header, you may need to enter the formula again to establish the column referencing.
prabharathi
Posts: 11
Joined: Fri Dec 08, 2017 4:37 pm

Re: Problems with IF function in Calc

Post by prabharathi »

Thank you. Shall check it out.
Yes there was a trailing space which caused the confusion
Last edited by prabharathi on Sun Jul 14, 2024 7:38 am, edited 1 time in total.
Open Office 4.1.4 on Windows 10
User avatar
Hagar Delest
Moderator
Posts: 33702
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: [Solved] #NAME? error when using column label

Post by Hagar Delest »

D2+B3-C3 is IMHO the leanest method. Why bother with formulas when logic and basic calculation does the job?
It also reduces CPU consumption and file size.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE 7 Gigi) and 25.2 portable on Windows 11.
prabharathi
Posts: 11
Joined: Fri Dec 08, 2017 4:37 pm

Re: [Solved] #NAME? error when using column label

Post by prabharathi »

Hagar Delest wrote: ↑Sat Jul 13, 2024 3:17 pm D2+B3-C3 is IMHO the leanest method. Why bother with formulas when logic and basic calculation does the job?
It also reduces CPU consumption and file size.
Very true. Thank you.
Open Office 4.1.4 on Windows 10
Post Reply