I am trying to write a formula for the following:
if(and(d3="normal credit",d3="loans-gen credit"),-e3,
if(and(d3="normal debit",d3="loans-gen debit"),+e3
I get the end result of FALSE.
Is there another formula solution for multiple questions?
Excel 2010 | |||||
---|---|---|---|---|---|
D | E | F | |||
3 | Normal Credit | 100 | 100 | ||
4 | Normal Debit | 200 | -200 | ||
5 | Service Charge | 10 | |||
6 | Loans-Gen Credit | 300 | 300 | ||
7 | Loans-Gen Debit | 400 | -400 | ||
8 | Monthly Fee | 20 | |||
9 | Normal Credit | 500 | 500 | ||
10 | Normal Debit | 600 | -600 | ||
Sheet13 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F3 | =IF(OR(D3={"Normal Credit","Loans-Gen Credit"}),E3,IF(OR(D3={"Normal Debit","Loans-Gen Debit"}),-E3,"")) | |
F6 | =IF(ISNUMBER(SEARCH("Credit",D6)),E6,IF(ISNUMBER(SEARCH("Debit",D6)),-E6,"")) | |
F9 | =IF(OR(D9={"Normal Credit","Loans-Gen Credit"}),E9,-E9) |
Excel 2010 | |||||
---|---|---|---|---|---|
D | E | F | |||
3 | Normal Credit | 100 | -100 | ||
4 | Normal Debit | 200 | 200 | ||
5 | Service Charge | 10 | |||
6 | Loans-Gen Credit | 300 | -300 | ||
7 | Loans-Gen Debit | 400 | 400 | ||
8 | Monthly Fee | 20 | |||
9 | Normal Credit | 500 | -500 | ||
10 | Normal Debit | 600 | 600 | ||
Sheet13 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F3 | =IF(OR(D3={"Normal Credit","Loans-Gen Credit"}),-E3,IF(OR(D3={"Normal Debit","Loans-Gen Debit"}),E3,"")) | |
F6 | =IF(ISNUMBER(SEARCH("Credit",D6)),-E6,IF(ISNUMBER(SEARCH("Debit",D6)),E6,"")) | |
F9 | =IF(OR(D9={"Normal Credit","Loans-Gen Credit"}),-E9,E9) |
I am trying to write a formula for the following:
if(and(d3="normal credit",d3="loans-gen credit"),-e3,
if(and(d3="normal debit",d3="loans-gen debit"),+e3
I get the end result of FALSE.
Is there another formula solution for multiple questions?
No, I see that is an error in my formula. The cell d3 can be any of 4 options - normal debit, normal credit, loans-gen debit or loans-gen credit. If the cell is normal debit or loans-gen debit I need the formal to bring back the positive result in E3 (which will always be a number). If D3 is normal credit or loans-gen credit, I need the result to be -e3 (the negative of e3).
[TABLE="width: 0"]
<tbody>[TR]
[TD]
[/TD]
[TD="width: 81, bgcolor: transparent"]
[/TD]
[TD="class: xl64, width: 86, bgcolor: transparent"]I need the following result:[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Normal Credit[/TD]
[TD="class: xl63, bgcolor: transparent"]352.07 [/TD]
[TD="class: xl63, bgcolor: transparent"](352.07)[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Loans-Gen Debit[/TD]
[TD="class: xl63, bgcolor: transparent"]3.28 [/TD]
[TD="class: xl63, bgcolor: transparent"]3.28 [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Loans-Gen Debit[/TD]
[TD="class: xl63, bgcolor: transparent"]23.89 [/TD]
[TD="class: xl63, bgcolor: transparent"]23.89 [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Loans-Gen Credit[/TD]
[TD="class: xl63, bgcolor: transparent"]3,558.95 [/TD]
[TD="class: xl63, bgcolor: transparent"](3,558.95)[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Loans-Gen Credit[/TD]
[TD="class: xl63, bgcolor: transparent"]401.58 [/TD]
[TD="class: xl63, bgcolor: transparent"](401.58)[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Normal Debit[/TD]
[TD="class: xl63, bgcolor: transparent"]103,537.78 [/TD]
[TD="class: xl63, bgcolor: transparent"]103,537.78 [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Normal Debit[/TD]
[TD="class: xl63, bgcolor: transparent"]314,716.94 [/TD]
[TD="class: xl63, bgcolor: transparent"]314,716.94 [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Normal Credit[/TD]
[TD="class: xl63, bgcolor: transparent"]134,282.16 [/TD]
[TD="class: xl63, bgcolor: transparent"](134,282.16)[/TD]
[/TR]
</tbody>[/TABLE]
Thank you!!!Hi,
Looking at your sample, I think you need the OR function rather than AND.
If you have Other possible terms in D3, use formula in F3.
If the Key words are "Credit", and "Debit", you can use the formula in F6.
If there are no Other possible terms in D3 Other than ?Credit, and ?Debit, you can use the formula in F9.
Excel 2010
D E F Normal Credit Normal Debit Service Charge Loans-Gen Credit Loans-Gen Debit Monthly Fee Normal Credit Normal Debit
<colgroup><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]3[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]100[/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]-200[/TD]
[TD="align: center"]5[/TD]
[TD="align: right"]10[/TD]
[TD="align: center"]6[/TD]
[TD="align: right"]300[/TD]
[TD="align: right"]300[/TD]
[TD="align: center"]7[/TD]
[TD="align: right"]400[/TD]
[TD="align: right"]-400[/TD]
[TD="align: center"]8[/TD]
[TD="align: right"]20[/TD]
[TD="align: center"]9[/TD]
[TD="align: right"]500[/TD]
[TD="align: right"]500[/TD]
[TD="align: center"]10[/TD]
[TD="align: right"]600[/TD]
[TD="align: right"]-600[/TD]
</tbody>Sheet13
[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]F3[/TH]
[TD="align: left"]=IF(OR(D3={"Normal Credit","Loans-Gen Credit"}),E3,IF(OR(D3={"Normal Debit","Loans-Gen Debit"}),-E3,""))[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]F6[/TH]
[TD="align: left"]=IF(ISNUMBER(SEARCH("Credit",D6)),E6,IF(ISNUMBER(SEARCH("Debit",D6)),-E6,""))[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]F9[/TH]
[TD="align: left"]=IF(OR(D9={"Normal Credit","Loans-Gen Credit"}),E9,-E9)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]