How can I combine these two statements into one formula?
=IF(AND(B24=1,C24=10),C24,-5)
=IF(AND(B24=1,C24=-10),C24,"")
Thanks
How can I combine these two statements into one formula?
=IF(AND(B24=1,C24=10),C24,-5)
=IF(AND(B24=1,C24=-10),C24,"")
Thanks
Try:
=IF(B24=1,IF(ABS(C24)=10,C24,-5),"")
Where there is a will there are many ways.
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
This works for all conditions except B24=0 and C24=10 -- expect -5
Try this one.
![]()
=IF(AND(B24=1,C24=10),-5,IF(AND(B24=1,C24=-10),C24,""))
Notice my main language is not English.
I appreciate it, if you reply on my solution.
If you are satisfied with the solution, please mark the question solved.
You can add reputation by clicking on the star * add reputation.
(replied to another post -- sorry)
Hi wolfgang and welcome to the forum
Im sorry, but the logic of what you are trying to do, escapes me. just for now, lets ignore the B24=1 part, its the same in both
the 1st formula you test for C24=10 - if true, return C24
the 2nd formula you test for C24=-10 - if true, return C24
so, so far you are returning the same value for a true in both.
now to the 2nd part of each forumla...
1st formula...if C24 is not 10 then give -5
2nd formula...if C24 is not -10 then give ""
so my question is, if C24 is, say, 7...what result would you expect?
based on the 1st formula, C24 is not = 10, so the answer would be -5
but based on the 2nd formula, C24 is not = -10 so the answer would be ""
so........??
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
Hope this is clearer:
Condition , Result if true , Else
B24=1 and C24= 10 , D24= 10 , -5 (i.e., for any B24 <> 1 -- e.g., B24=0)
B24=1 and C24= -10 , D24= -10 , "" (i.e., for any B24 <> 1 -- e.g., B24=0)
Last edited by wolfgang713; 01-14-2013 at 05:39 PM.
Hope this is clearer:
Condition Result if true Else
B24=1 and C24= 10 D24= 10 -5 (i.e., for any B24 <> 1 -- e.g., B24=0)
B24=1 and C24= -10 D24= -10 "" (i.e., for any B24 <> 1 -- e.g., B24=0)
oeldere: Thanks. This works for all conditions except B24=0 and C24=10 -- expect -5
self deleted
A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
-Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
-To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
If you received helpful response, please remember to hit the * of that post
Try:
=IF(C24=10,IF(B24=1,C24,-5),IF(C24=-10,IF(B24=1,C24,""),""))
[QUOTE=NBVC;3082678]Try:
=IF(C24=10,IF(B24=1,C24,-5),IF(C24=-10,IF(B24=1,C24,""),""))
This works perfectly. Thanks.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks