Formulas within a Cell

%3CLINGO-SUB%20id%3D%22lingo-sub-2966890%22%20slang%3D%22en-US%22%3EFormulas%20within%20a%20Cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2966890%22%20slang%3D%22en-US%22%3E%3CP%3ELooking%20for%20a%20solution%20to%20total%20amounts%20from%20a%20range%20of%20cells%20with%20or%20without%20formulas%20that%20produce%20a%20net%20result.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EExample%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3BColumn%20A%20(rows%20of%20cells%20depicted%20below)%3C%2FP%3E%3CP%3E1%26nbsp%3B%20100.00%3C%2FP%3E%3CP%3E2%26nbsp%3B%20%26nbsp%3B%2050.00%20(100.00-50.00)%3C%2FP%3E%3CP%3E3%26nbsp%3B%20%26nbsp%3B%2025.00%20(50.00-25.00)%3C%2FP%3E%3CP%3E4%26nbsp%3B%20%26nbsp%3B125.00%20(150.00-25.00)%3C%2FP%3E%3CP%3E5%26nbsp%3B%20%26nbsp%3B300.00%20%26lt%3B-Total%20but%20actual%20amounts%20are%20%2B400.00%20and%20-100.00%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENumbers%20in%20parenthesis%20represent%20formulas%20within%20cells%20A2%2C%20A3%20%26amp%3B%20A4.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENeed%20a%20solution%2C%20without%20an%20additional%20column%2C%20to%20sum%20the%20positive%20amounts%20apart%20from%20the%20negative%20amounts.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2966890%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2966954%22%20slang%3D%22en-US%22%3ERe%3A%20Formulas%20within%20a%20Cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2966954%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1219260%22%20target%3D%22_blank%22%3E%40deschroeder%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3ECould%20you%20please%20add%20an%20example%20file%20(without%20sensitive%20data)%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3Ehow%20exactly%20it%20should%20be%20classified%20in%20the%20sheet%20and%20where%20you%20want%20which%20result.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3EExcel%20version%20and%20operating%20system%20would%20be%20an%20advantage%20to%20come%20up%20with%20a%20quick%20solution%20proposal.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3EHere%20is%20a%20small%20example%20(insert%20file).%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20understanding%20and%20patience%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENikolino%3C%2FP%3E%3CP%3EI%20know%20I%20don't%20know%20anything%20(Socrates)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2967026%22%20slang%3D%22en-US%22%3ERe%3A%20Formulas%20within%20a%20Cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2967026%22%20slang%3D%22en-US%22%3EI'm%20not%20seeing%20an%20option%20to%20include%20an%20attachment...%3C%2FLINGO-BODY%3E
Occasional Contributor

Looking for a solution to total amounts from a range of cells with or without formulas that produce a net result.

 

Example:

   Column A (rows of cells depicted below)

1  100.00

2    50.00 (100.00-50.00)

3    25.00 (50.00-25.00)

4   125.00 (150.00-25.00)

5   300.00 <-Total but actual amounts are +400.00 and -100.00

 

Numbers in parenthesis represent formulas within cells A2, A3 & A4.

 

Need a solution, without an additional column, to sum the positive amounts apart from the negative amounts.

 

Thank you.

 

 

 

 

 

8 Replies

@deschroeder 

Could you please add an example file (without sensitive data)

how exactly it should be classified in the sheet and where you want which result.

Excel version and operating system would be an advantage to come up with a quick solution proposal.

 

Here is a small example (insert file).

 

Thank you for your understanding and patience

 

Nikolino

I know I don't know anything (Socrates)

I'm not seeing an option to include an attachment...
Figured it out.

@deschroeder 

As variant

Anvances:
=LET(
 range, A1:A4,
 str, SUBSTITUTE( FORMULATEXT(range), "=", "" ),
 pos, FIND( "-", str ),
 SUM( IFNA( --LEFT( str, pos -1 ), range ) ) )

Payments:
=LET(
 range, A1:A4,
 str, SUBSTITUTE( FORMULATEXT(range), "=", "" ),
 pos, FIND( "-", str ),
 -SUM( IFNA( --RIGHT( str, LEN(str) - pos ), 0 ) ) )

@Sergei Baklan 

Thank you for your solution.

 

Can this be accomplished using existing Excel functions without using VBA?

 

@deschroeder 

That's not VBA, that's existing LET function (microsoft.com) . Availability depends on your Excel version and platform.

OK, I see that now, I'm a version behind but will upgrade and put your solution into practice. Thank you!

@deschroeder , you are welcome