This simple IF(J2="true",e2,g2) doesn't work.

yabi100

Board Regular
Joined
Aug 10, 2013
Messages
89
Office Version
  1. 2016
Platform
  1. Windows
What is wrong with this formula in this table?
IF(J2="true",e2,g2)
 

Attachments

  • if command mrexcel.JPG
    if command mrexcel.JPG
    100.7 KB · Views: 15

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
What is wrong with this formula in this table?
Assuming the col J values are logical values and not text values, then the "TRUE" should not have the quote marks
Excel Formula:
=IF(J2=TRUE,E2,G2)

But you don't need the TRUE at all, try
Excel Formula:
=IF(J2,E2,G2)
 
Upvote 0
Assuming the col J values are logical values and not text values, then the "TRUE" should not have the quote marks
Excel Formula:
=IF(J2=TRUE,E2,G2)

But you don't need the TRUE at all, try
Excel Formula:
=IF(J2,E2,G2)
True is a logical a value. Result of =ISNUMBER(Sheet1!$E2)
But your solution didn't solve the problem. Is there any idea how can I solve this issue?
It is very odd that, even it has a = sign at the beginning, but it doesn't change into formula and remains as it is a text.
 

Attachments

  • if command mrexcel2.JPG
    if command mrexcel2.JPG
    21.6 KB · Views: 3
Upvote 0
one more question, although it is not related to IF command.
My table doesn't have blank cells, but when I make a pivot table, blanks appear both in rows and columns. What does it mean and how can I solve this issue?
 

Attachments

  • blanks in pivot table.JPG
    blanks in pivot table.JPG
    64.4 KB · Views: 7
Upvote 0
Assuming the col J values are logical values and not text values, then the "TRUE" should not have the quote marks
Excel Formula:
=IF(J2=TRUE,E2,G2)

But you don't need the TRUE at all, try
Excel Formula:
=IF(J2,E2,G2)
The problem is not with IF command as no other IF command works. This table doesn't accept any formula, even F2=E1+E2. I should look for formula input options.
 
Upvote 0
Your cells are most likely formatted as Text. Change to General and re-enter the formula again.
 
Upvote 0

Forum statistics

Threads
1,223,993
Messages
6,175,844
Members
452,675
Latest member
duongtruc1610

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top