Two Value if true, one value if false

thirdeye85

New Member
Joined
Aug 11, 2021
Messages
28
Office Version
  1. 2019
Platform
  1. MacOS
Hi there,


My question pertains to the =IF function, specifically having multiple conditional statements within one formula. Currently I have just one conditional statement at the top of the formula which I call, “CC” short for credit card transaction fees. When I denote “CC” to a particular column excel adds on a credit card percentage plus a flat rate of ten cents to another corresponding column.

The structure of my =IF function, If the cell does not equal to “CC”, than value if true would be value entered without credit card fees calculated, in my situation cash or check or some other variable. And then the value if false is my calculation for transaction fees.

My predicament is I would like to embed another conditional statement or variable within this formula. Instead of just “CC” I would like “CC” and “CC2” which would have different values calculated as needed. I believe what I am attempting to do is create two “value if true” followed by a “value if false”.


I tried tweaking my current formula with something like this, but to no avail:


=IF($B17<>"CC", “CC2”,


Am Incorrect in thinking that this is possible with the current IF formula because there is only one true and false statement, if so is there a more suitable formula for this? I was toying around with the =IFS formula and noticed that you can build multiple true statements within. Any help would be appreciated..


General_Ledger_2024.xlsx
BCDEFGHIJKL
17CC11/3/24BankIncome$ 90.00$ 90.00$90.00$87.56$87.56$0.00
Test
Cell Formulas
RangeFormula
C17C17=MONTH([@Date])
I17I17=IF($B17<>"CC", IF($E17=J$1,-$G17,IF($F17=J$1,$H17,0)), IF($E17=J$1,-$G17,IF($F17=J$1,($H17),0)))
J17,L17J17=IF($B17<>"CC", IF($E17=J$1,-$G17,IF($F17=J$1,$H17,0)), IF($E17=J$1,-$G17 - ROUND($G17*0.026,2)-(MOD(ROUND($G17*1000,2),20)=5)/100-0.1,IF($F17=J$1,($H17 - ROUND($H17*0.026,2)-(MOD(ROUND($H17*1000,2),20)=5)/100-0.1),0)))
K17K17=IF($B17<>"CC", IF($E17=K$1,$G17,IF($F17=K$1,-$H17,0)), IF($E17=K$1,$G17 - ROUND($G17*0.026,2)-(MOD(ROUND($G17*1000,2),20)=5)/100-0.1,IF($F17=K$1,-($H17 - ROUND($H17*0.026,2)-(MOD(ROUND($H17*1000,2),20)=5)/100-0.1),0)))
 

Attachments

  • Screen Shot 2024-06-20 at 7.59.14 AM.png
    Screen Shot 2024-06-20 at 7.59.14 AM.png
    36.1 KB · Views: 7
  • Screen Shot 2024-06-20 at 7.59.26 AM.png
    Screen Shot 2024-06-20 at 7.59.26 AM.png
    5.4 KB · Views: 6

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
I am kind of confused by your explanation, but you can definitely have nested IF statement, and IF statements with multiple conditions, by using the AND and OR functions.

For example, if you wanted to first check to be if the value is NOT either CC or CC2, you could use:
Excel Formula:
=IF(AND($B17<>"CC,$B17<>"CC2"),...

And here is an article on nested IF formulas: IF function – nested formulas and avoiding pitfalls - Microsoft Support
 
Upvote 0
Hi there,

Thank you for the reply Joe. I applied the above function and it worked, however, it's not doing what I would like it to do. I understand the logic of the formula basically IF both CC & CC2 are input into cell B17 than "DO THIS", both conditions need to be met. I do not require both conditions to be met.

I would like Variable X if met, = Y, Variable T if met = Z

So I require different outputs for each variable. For instance, if CC is input "DO THIS1", if CC2 is input "DOTHIS2". They have different outputs depending on which variable is used.
 
Upvote 0
So I require different outputs for each variable. For instance, if CC is input "DO THIS1", if CC2 is input "DOTHIS2". They have different outputs depending on which variable is used.
Did you look at my link on Nested IFs? This is very easy with a simple nested IF, i.e.
Excel Formula:
=IF($B17="CC","DO THIS1",IF($B17="CC2","DO THIS2","Cell is neither value"))
 
Upvote 0
Solution
Thank you this worked like a charm. I couldn't make sense of the nested IF on the web-site but with your clarification it makes sense. Thanks so much!
 
Upvote 0
You are welcome!
Glad I was able to help.
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,081
Members
453,021
Latest member
Justyna P

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