Avatar of LUIS FREUND
LUIS FREUND
 asked on

Calculating two columns to get a positive and negative number

Wanted to calculate two columns to get a positive and negative number.  On column L I've manually calculated the values that I'm trying to get.  

Wrote out explanations on the attachment to get the desired results and rationale.

See attachment
CALC-DEMAND.xlsx
Microsoft OfficeMicrosoft Excel

Avatar of undefined
Last Comment
Subodh Tiwari (Neeraj)

8/22/2022 - Mon
Subodh Tiwari (Neeraj)

Hi Luis,

Maybe you need this...
=IF(COUNTIF(F$3:F3,F3)<>COUNTIF([PN],F3),"",I3-SUMIF([PN],F3,[NOT ISSUED]))

Open in new window

and copy it down.
LUIS FREUND

ASKER
Thank you Neeraj!  It does work but I applied it to my data set and for some reason it does not like the column called "Part No".  I attached it for your review.  I believe it's how the column is formatted.
C--Users-lfreund-Documents-EE-CALC.xlsx
Subodh Tiwari (Neeraj)

Please check the attached and let me know what is not working.
C--Users-lfreund-Documents-EE-CALC.xlsx
Your help has saved me hundreds of hours of internet surfing.
fblack61
LUIS FREUND

ASKER
Hi Neeraj,

I lightheaded in yellow what is not working for me, see attachment.   Thanks!
C--Users-lfreund-Documents-EE-CALC.xlsx
ASKER CERTIFIED SOLUTION
Subodh Tiwari (Neeraj)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
LUIS FREUND

ASKER
Thanks....I added values to column N.  I also added the full data set as well.

See attachment.
C--Users-lfreund-Documents-EE-CALC-.xlsx
Subodh Tiwari (Neeraj)

Column N in your file contains the formula which include the ranges up to row30. Is that correct?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
LUIS FREUND

ASKER
yes.... but is there a way to apply the formula to the full range which is to row 27531
Subodh Tiwari (Neeraj)

What's your actual requirement?
Do you need consolidated stock qty for a part number or qty for a part number for the current row?
e.g. if you look at part number in F3 (031-00268), there are 35 occurrences of 031-00268 in the data set so what should be the stock qty for all of them? i.e. stock qty for individual row or consolidated stock qty? Sorry if I am missing the logic here.


Part-Number.jpg
LUIS FREUND

ASKER
I would need qty for the individual row.  It's also based on dates.  So for example a part no can show up for multiple months.  So if I choose Jan I would like to see the individual stock qty for that given month.

The data is set to ascending order by date and part no.  Then I would filter to a given month.
C--Users-lfreund-Documents-EE-CALC-.xlsx
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
LUIS FREUND

ASKER
My apologies for not being clear.....
Subodh Tiwari (Neeraj)

It's still not clear.
Please look at the following image where you have multiple occurrences of same part number for January. Which output is correct? Yellow or Green?
C--Users-lfreund-Documents-EE-CALC.jpgC--Users-lfreund-Documents-EE-CALC-.xlsx
LUIS FREUND

ASKER
Green would be correct....
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Subodh Tiwari (Neeraj)

Then you should keep the formula in column M.
LUIS FREUND

ASKER
ah okay...looks good
LUIS FREUND

ASKER
Thank you so much Neeraj!  As always a tremendous help!!!
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Subodh Tiwari (Neeraj)

You're welcome Luis!