SOLVED

Excel Formula needed

%3CLINGO-SUB%20id%3D%22lingo-sub-1600775%22%20slang%3D%22en-US%22%3EExcel%20Formula%20needed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1600775%22%20slang%3D%22en-US%22%3E%3CTABLE%20width%3D%22340%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%2240px%22%20height%3D%2229px%22%3EP%3C%2FTD%3E%3CTD%20width%3D%2240px%22%20height%3D%2229px%22%3EP%3C%2FTD%3E%3CTD%20width%3D%2240px%22%20height%3D%2229px%22%3EF%3C%2FTD%3E%3CTD%20width%3D%2240px%22%20height%3D%2229px%22%3EP5%3C%2FTD%3E%3CTD%20width%3D%2240px%22%20height%3D%2229px%22%3EP3%3C%2FTD%3E%3CTD%20width%3D%2240px%22%20height%3D%2229px%22%3EP3%3C%2FTD%3E%3CTD%20width%3D%2240px%22%20height%3D%2229px%22%3EP14%3C%2FTD%3E%3CTD%20width%3D%2240px%22%20height%3D%2229px%22%3EP13%3C%2FTD%3E%3CTD%20width%3D%2240px%22%20height%3D%2229px%22%3EP13%3C%2FTD%3E%3CTD%20width%3D%2240px%22%20height%3D%2229px%22%3EP-3%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eis%20there%20a%20formula%20that%20helps%20me%20recognize%20and%20calculate%20the%20total%20amount%3C%2FP%3E%3CP%3EP5%2BP3%2BP3%2BP14%2BP13%2BP13%20%3D%2051%20Hrs%3C%2FP%3E%3CP%3EThat%20only%20recognize%20the%20positive%20%26amp%3B%20the%20letter%20P%20(for%20present)%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eit%20would%20really%20be%20appreciated%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1600775%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-1600840%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20needed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1600840%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F765412%22%20target%3D%22_blank%22%3E%40Fayezsamea%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20find%20below%20construction%20of%20the%20formula%20which%20help%20you%20to%20get%20the%20desired%20result.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3DSUMPRODUCT(IF(IF(LEFT(A3%3AJ3%2C1)%3D%22P%22%2CIFERROR(VALUE(MID(A3%3AJ3%2C2%2C5))%2C0)%2C0)%26gt%3B%3D0%2CIF(MID(A3%3AJ3%2C1%2C1)%3D%22P%22%2CIFERROR(VALUE(MID(A3%3AJ3%2C2%2C5))%2C0)%2C0)%2C0))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Snag_aed5df.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F213422i38BE19FFB47B2022%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Snag_aed5df.png%22%20alt%3D%22Snag_aed5df.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ERegards%2C%20Faraz%20Shaikh%20%7C%20MCT%2C%20MIE%2C%20MOS%20Master%2C%20Excel%20Expert%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3E%3CFONT%20color%3D%22%23808080%22%3EIf%20you%20find%20the%20above%20solution%20resolved%20your%20query%20don't%20forget%20mark%20as%26nbsp%3B%3CSPAN%3EOfficial%2FBest%20Answer%26nbsp%3Bto%20help%20the%20other%20members%20find%20it%20more%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1601893%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20needed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1601893%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F156456%22%20target%3D%22_blank%22%3E%40Faraz%20Shaikh%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ei%20am%20trying%20to%20make%20it%20work%20but%20it%20doesn't%20seem%20to%20work%20for%20me%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1601926%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20needed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1601926%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F765412%22%20target%3D%22_blank%22%3E%40Fayezsamea%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20a%20variant%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DSUM(IFERROR(--SUBSTITUTE(A3%3AJ3%2C%22P%22%2C%22%22)%2C0))%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EIf%20your%20Excel%20doesn't%20support%20dynamic%20arrays%20when%20array%20formula%20(Ctrl%2BShift%2BEnter%20to%20enter)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1601992%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20needed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1601992%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethank%20you%20so%20much%2C%20what%20if%20I%20want%20only%20the%20positive%20value%26nbsp%3B%3C%2FP%3E%3CTABLE%20width%3D%22182%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%2226%22%3EP3%3C%2FTD%3E%3CTD%20width%3D%2226%22%3EP3%3C%2FTD%3E%3CTD%20width%3D%2226%22%3EP3%3C%2FTD%3E%3CTD%20width%3D%2226%22%3EP3%3C%2FTD%3E%3CTD%20width%3D%2226%22%3EP%3C%2FTD%3E%3CTD%20width%3D%2226%22%3EP-3%3C%2FTD%3E%3CTD%20width%3D%2226%22%3EP13%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20calculate%20only%20the%20value%20more%20than%20zero%20and%20another%20one%20with%20the%20negative%20values%20only%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1601997%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20needed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1601997%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F765412%22%20target%3D%22_blank%22%3E%40Fayezsamea%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESorry%2C%20missed%20that%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3EPositive%20only%3A%0A%3DSUMPRODUCT(IFERROR(--SUBSTITUTE(A3%3AJ3%2C%22P%22%2C%22%22)%2C0)*(IFERROR(--SUBSTITUTE(A3%3AJ3%2C%22P%22%2C%22%22)%2C0)%26gt%3B0))%0A%0ANegative%20only%3A%0A%3DSUMPRODUCT(IFERROR(--SUBSTITUTE(A3%3AJ3%2C%22P%22%2C%22%22)%2C0)*(IFERROR(--SUBSTITUTE(A3%3AJ3%2C%22P%22%2C%22%22)%2C0)%26lt%3B0))%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Occasional Contributor
PPFP5P3P3P14P13P13P-3

 

is there a formula that helps me recognize and calculate the total amount

P5+P3+P3+P14+P13+P13 = 51 Hrs

That only recognize the positive & the letter P (for present) 

 

it would really be appreciated

5 Replies

Hi @Fayezsamea

 

Please find below construction of the formula which help you to get the desired result.

 

 

=SUMPRODUCT(IF(IF(LEFT(A3:J3,1)="P",IFERROR(VALUE(MID(A3:J3,2,5)),0),0)>=0,IF(MID(A3:J3,1,1)="P",IFERROR(VALUE(MID(A3:J3,2,5)),0),0),0))

 

 

 

Snag_aed5df.png

 

Regards, Faraz Shaikh | MCT, MIE, MOS Master, Excel Expert

If you find the above solution resolved your query don't forget mark as Official/Best Answer to help the other members find it more

 

@Faraz Shaikh 

 

i am trying to make it work but it doesn't seem to work for me

@Fayezsamea 

As a variant

=SUM(IFERROR(--SUBSTITUTE(A3:J3,"P",""),0))

If your Excel doesn't support dynamic arrays when array formula (Ctrl+Shift+Enter to enter)

Hi@Sergei Baklan 

 

thank you so much, what if I want only the positive value 

P3P3P3P3PP-3P13

 

I want to calculate only the value more than zero and another one with the negative values only

 

best response confirmed by Fayezsamea (Occasional Contributor)
Solution

@Fayezsamea 

Sorry, missed that

Positive only:
=SUMPRODUCT(IFERROR(--SUBSTITUTE(A3:J3,"P",""),0)*(IFERROR(--SUBSTITUTE(A3:J3,"P",""),0)>0))

Negative only:
=SUMPRODUCT(IFERROR(--SUBSTITUTE(A3:J3,"P",""),0)*(IFERROR(--SUBSTITUTE(A3:J3,"P",""),0)<0))