SOLVED

Return Positive Value if "Yes" Return Negative Value if "No"

%3CLINGO-SUB%20id%3D%22lingo-sub-1620193%22%20slang%3D%22en-US%22%3ERe%3A%20Return%20Positive%20Value%20if%20%22Yes%22%20Return%20Negative%20Value%20if%20%22No%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1620193%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F767963%22%20target%3D%22_blank%22%3E%40RepublicsFury%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20general%20formula%20works%2C%20I'm%20not%20sure%20about%20business%20logic%20(what%20it%20shall%20to%20calculate).%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20635px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F215307iC5F9E645C5240D55%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAt%20least%20no%20errors.%20Better%20if%20you%20submit%20small%20sample%20file%20to%20illustrate%20an%20issue.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1620390%22%20slang%3D%22en-US%22%3ERe%3A%20Return%20Positive%20Value%20if%20%22Yes%22%20Return%20Negative%20Value%20if%20%22No%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1620390%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F767963%22%20target%3D%22_blank%22%3E%40RepublicsFury%3C%2FA%3E%26nbsp%3B%20I%20noticed%20that%20you%20reference%20I39%20for%20the%20%22Yes%22%20and%20L39%20for%20the%20%22No%22.%26nbsp%3B%20so%20is%20the%20I%20a%20capital%20i%20or%20a%20lowercase%20L%3F%26nbsp%3B%20In%20other%20words%20should%20L39%20be%20I39%20instead%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1620695%22%20slang%3D%22en-US%22%3ERe%3A%20Return%20Positive%20Value%20if%20%22Yes%22%20Return%20Negative%20Value%20if%20%22No%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1620695%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3BIt's%20a%20type.%20Should%20be%20I%20for%20the%20whole%20thing%2C%20sorry%20for%20the%20confusion%20.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1620068%22%20slang%3D%22en-US%22%3EReturn%20Positive%20Value%20if%20%22Yes%22%20Return%20Negative%20Value%20if%20%22No%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1620068%22%20slang%3D%22en-US%22%3E%3CP%3EI%20wrote%20this%20and%20put%20it%20in%20K39%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(I39%3D%22%22%2C%22%22%2CIF(D39%3D%22Yes%22%2CI39*G39%2CIF(D39%3D%22No%22%2C-(I39*G39)%2C%22%22)))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI39%20%3D%20Sale%20Price%3C%2FP%3E%3CP%3ED39%20%3D%20Is%20the%20Invoice%20Paid%20(Yes%2FNo)%3C%2FP%3E%3CP%3EG39%20%3D%20Qty%20Sold%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20input%3A%20I39%20%3D%20%24550.00%2C%20D39%20%3D%20Yes%20or%20No%20(to%20test%20the%20formula)%2C%26nbsp%3B%20G39%20%3D%201%20(for%20testing).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20hoping%20that%20if%20there%20is%20no%20value%20for%20the%20sale%20entered%20then%20K39%20(where%20the%20formula%20is%20input)%20will%20be%20blank.%20If%20the%20invoice%20has%20been%20paid%20then%20the%20sale%20price%20will%20be%20positive%20if%20not%20then%20the%20sale%20price%20will%20be%20negative.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELower%20down%20I'm%20going%20to%20SUM%20K39%20and%20then%20take%20.35%25%20of%20that%20value%20for%20commission%20to%20the%20salesman.%20My%20problem%20is%20the%20formula%20isn't%20working%20and%20I've%20tried%20several%20things.%20Would%20love%20some%20help.%20Here's%20how%20it%20acts%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20D39%20%3D%20No%20K39%20returns%20%22%23VALUE!%22%3C%2FP%3E%3CP%3EWhen%20D39%20%3D%20Yes%20K39%20returns%20%24500.00%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1620068%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1620699%22%20slang%3D%22en-US%22%3ERe%3A%20Return%20Positive%20Value%20if%20%22Yes%22%20Return%20Negative%20Value%20if%20%22No%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1620699%22%20slang%3D%22en-US%22%3E%3CP%3EI%20figured%20out%20how%20to%20make%20the%20formula%20do%20what%20I'm%20wanting%20it%20to%20do.%20I%20was%20looking%20for%20it%20to%20return%20a%20value%20that%20wouldn't%20be%20calculable%20in%20the%20sum%2C%20in%20essence%20blank.%20So%20really%20the%20formula%20worked%20I%20was%20just%20looking%20at%20it%20wrong.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(I39%3D%22%22%2C%22%22%2CIF(D39%3D%22Yes%22%22%2CI39*G39%2CIF(D39%3D%22No%22%2C-(I39*G39)%2C%22%22)))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYes%3A%20Returns%20value%20of%20I39*G39%26nbsp%3B%3C%2FP%3E%3CP%3ENo%3A%20Returns%20value%20of%20negative.%20But%20I%20didn't%20want%20it%20in%20the%20sum.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20I%20simply%20changed%20the%20formula%20to%20this%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(I73%3D%22%22%2C%22%22%2CIF(D73%3D%22Yes%22%2CI73*G73%2CIF(D73%3D%22No%22%2C0%2C%22%22)))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYes%3A%20Returns%20value%20of%20I39*G39%3C%2FP%3E%3CP%3ENo%3A%20Returns%20%240.00%20and%20if%20it's%20not%20Yes%20or%20No%20it's%20blank.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20this%20works.%20It%20also%20shows%20that%20there's%20a%20typo%20expecting%20it%20to%20either%20be%20a%20positive%20number%20or%200.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20also%20replace%20the%20zero%20after%20the%20No%20with%20a%20%22%22%2C%22%22%20instead%20and%20get%20blank%20if%20it%20is%20No%20or%20something%20other%20than%20Yes.%20I%20think%20the%200%20is%20better%20because%20it%20can't%20be%20included%20in%20the%20SUM%20and%20it%20shows%20that%20you%20have%20an%20invoice%20that%20hasn't%20been%20paid.%20It%20may%20not%20be%20the%20best%20formula%20but%20it%20works.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EA%20big%20thank%20you%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3ESergei%20Baklan%3C%2FA%3E%26nbsp%3Bbecause%20I%20looked%20at%20his%20formula%20and%20then%20the%20light%20bulb%20came%20on%20and%20I%20realized%20that%20I%20didn't%20want%20it%20to%20express%20a%20negative%20(which%20indicated%20that%20it%20hadn't%20been%20paid%2C%20issue%20is%20that%20it%20calculates%20that%20negative%20in%20the%20SUM)%2C%20instead%20I%20wanted%20it%20to%20not%20be%20added%20or%20subtracted%20from%20the%20SUM%20and%20therefore%20a%20%240.00%20or%20a%20Blank%20would%20be%20best.%20So%20thanks%20Sergei...%20you%20turned%20the%20light%20on!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1620853%22%20slang%3D%22en-US%22%3ERe%3A%20Return%20Positive%20Value%20if%20%22Yes%22%20Return%20Negative%20Value%20if%20%22No%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1620853%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F767963%22%20target%3D%22_blank%22%3E%40RepublicsFury%3C%2FA%3E%26nbsp%3B%2C%20glad%20to%20help%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

I wrote this and put it in K39:

 

=IF(I39="","",IF(D39="Yes",I39*G39,IF(D39="No",-(I39*G39),"")))

 

I39 = Sale Price

D39 = Is the Invoice Paid (Yes/No)

G39 = Qty Sold

 

I input: I39 = $550.00, D39 = Yes or No (to test the formula),  G39 = 1 (for testing).

 

I'm hoping that if there is no value for the sale entered then K39 (where the formula is input) will be blank. If the invoice has been paid then the sale price will be positive if not then the sale price will be negative. 

 

Lower down I'm going to SUM K39 and then take .35% of that value for commission to the salesman. My problem is the formula isn't working and I've tried several things. Would love some help. Here's how it acts:

 

When D39 = No K39 returns "#VALUE!"

When D39 = Yes K39 returns $500.00

5 Replies
Highlighted

@RepublicsFury 

In general formula works, I'm not sure about business logic (what it shall to calculate).

image.png

At least no errors. Better if you submit small sample file to illustrate an issue.

Highlighted

@RepublicsFury  I noticed that you reference I39 for the "Yes" and L39 for the "No".  so is the I a capital i or a lowercase L?  In other words should L39 be I39 instead?

Highlighted

@mtarler It's a type. Should be I for the whole thing, sorry for the confusion .

 

Highlighted
Best Response confirmed by RepublicsFury (Occasional Contributor)
Solution

I figured out how to make the formula do what I'm wanting it to do. I was looking for it to return a value that wouldn't be calculable in the sum, in essence blank. So really the formula worked I was just looking at it wrong.

 

=IF(I39="","",IF(D39="Yes"",I39*G39,IF(D39="No",-(I39*G39),"")))

 

Yes: Returns value of I39*G39 

No: Returns value of negative. But I didn't want it in the sum.

 

So I simply changed the formula to this

 

=IF(I73="","",IF(D73="Yes",I73*G73,IF(D73="No",0,"")))

 

Yes: Returns value of I39*G39

No: Returns $0.00 and if it's not Yes or No it's blank.

 

So this works. It also shows that there's a typo expecting it to either be a positive number or 0. 

 

You can also replace the zero after the No with a "","" instead and get blank if it is No or something other than Yes. I think the 0 is better because it can't be included in the SUM and it shows that you have an invoice that hasn't been paid. It may not be the best formula but it works. 

 

A big thank you to Sergei Baklan because I looked at his formula and then the light bulb came on and I realized that I didn't want it to express a negative (which indicated that it hadn't been paid, issue is that it calculates that negative in the SUM), instead I wanted it to not be added or subtracted from the SUM and therefore a $0.00 or a Blank would be best. So thanks Sergei... you turned the light on!

Highlighted