HAVING TROUBLE WITH =IF FUNCTION

Discuss the spreadsheet application
Post Reply
folyeta
Posts: 1
Joined: Mon Sep 09, 2019 10:04 pm

HAVING TROUBLE WITH =IF FUNCTION

Post by folyeta »

I am trying to write this code but am having trouble please someone help.
In C49 I am wanting the value of C29:C45 IF B29:B45 = MIDAMERICA
What am I doing wrong?

Code: Select all

=IF(B29:C45="MIDAMERICA";C29:C45)
Thanks in advance
Last edited by RusselB on Tue Sep 10, 2019 2:51 am, edited 2 times in total.
Reason: removed toxic topic icon.. All caps replaced with sentence structure and code tags add by RusselB
APACHE OPEN OFFICE 4.1.6
WINDOWS 10
FJCC
Moderator
Posts: 9280
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: HAVING TROUBLE WITH =IF FUNCTION

Post by FJCC »

You cannot put the values of many cells into one cell. Why do you want to do this? What are you trying to achieve?

Please do not write in all caps. It looks like shouting.
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.
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: HAVING TROUBLE WITH =IF FUNCTION

Post by RusselB »

If you are wanting the value from column C if the value in the same row in column B matches your text, but only want the information placed in a single cell, then you could try this as an array formula, meaning that you would enter your formula, but instead of pressing Enter when done, you would press Ctrl+Shift+Enter.

Please note that if you have multiple matches, it's my understanding that only the first match will be returned.
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
keme
Volunteer
Posts: 3705
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: HAVING TROUBLE WITH =IF FUNCTION

Post by keme »

With an array formula you may get what you are after. One value for each referenced cell, in a new array.

However, I suspect that you need only one column returned. Use only column B in the first argument. Also, if you don't give the third argument, logical FALSE value is returned instead.

Code: Select all

=IF(B29:B45="MIDAMERICA";C29:C45;"---")
Entered with ctrl+shift+enter, this will fill 17 cells down, one for each cell in the range you are testing.

If you only want one single value returned, you may need the VLOOKUP() function instead of an array-IF()
Post Reply