Forum

Notifications
Clear all

IF Formula

6 Posts
2 Users
0 Reactions
87 Views
(@lisah)
Posts: 4
Active Member
Topic starter
 

I have this formula that is working:
=IF((OR(K2="V",K2="M",K2="D")),J2)
Which tells me if cell K2 equals either V, M, or D then populate cell L2 with the value in cell J2. However, I only want the formula to be used if the value in cell A2="1"...how can I accomplish that?

Sample.PNG

 
Posted : 08/11/2017 4:09 pm
(@fravis)
Posts: 337
Reputable Member
 

Welcome here Lisa. I think you're looking for:

=IF(A2=1,IF((OR(K2="V",K2="M",K2="D")),J2,""),"")

When criteria doesn't match, it gives a blank in return

Frans

 
Posted : 08/11/2017 4:39 pm
(@lisah)
Posts: 4
Active Member
Topic starter
 

Amazing!! Thank you very much!!!

 
Posted : 08/11/2017 5:02 pm
(@lisah)
Posts: 4
Active Member
Topic starter
 

I have one more variable to add to this. Can you help? If the value of any cell in column C = "R" (refund) then the value in the corresponding cell in column "J" needs to be a negative number. Is this possible?

 
Posted : 17/11/2017 11:58 am
(@fravis)
Posts: 337
Reputable Member
 

Well, when looking at your picture file, it looks like column ´J´ is filled in directly (I mean not with a formula). So then it's not possible. Correct me if I'm wrong, but maybe then it's better to have a sample file in stead of a picture.

There is a workaround though. Add an extra column (let's say in between column J and K). In that column K you can simply add something like: "If(C2="R",-J2,J2). In this new K column comes the values you need. So you then have to change the first given solution in:

=IF(A2=1,IF((OR(K2="V",K2="M",K2="D")),K2,""),"").

That'll work fine.

Frans

 
Posted : 17/11/2017 6:16 pm
(@lisah)
Posts: 4
Active Member
Topic starter
 

This works perfectly! I added a column and made it the destination for the first formula =IF(C2="R",-J2,J2) then changed my other 2 formulas to use the value in that column instead of the previous one.

Thank you so much for your help!!

 
Posted : 18/11/2017 11:57 am
Share: