Formula to Subtract two values based on the latest values on Weekdays

waseem0888

New Member
Joined
Aug 18, 2021
Messages
8
Office Version
  1. 365
  2. 2016
  3. 2013
  4. 2010
Platform
  1. Windows
Hello,

I need a formula to subtract the two latest cells values based on the values in the cells of a particular day.
For example, I did my entries on Saturday in cells D9 and F9 I want to subtract these two values 1100 - 200 which will result in column AP9 1100-200 = 900
So next day I again on Sunday I insert values in I9 and K9 where I want subtraction but the result should be reflected in the same cell No. AP9
this is what I want for my whole week result should be calculated in AP9 and the logical purpose is to avoid inserting several columns for subtraction with each day.
Just want the current day result should be in one column Cell No. AP9.

Thanks,
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Welcome to the MrExcel board!

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Hello,

I need a formula to subtract the two latest cells values based on the values in the cells of a particular day.
For example, I did my entries on Saturday in cells D9 and F9 I want to subtract these two values 1100 - 200 which will result in column AP9 1100-200 = 900
So next day I again on Sunday I insert values in I9 and K9 where I want subtraction but the result should be reflected in the same cell No. AP9
this is what I want for my whole week result should be calculated in AP9 and the logical purpose is to avoid inserting several columns for subtraction with each day.
Just want the current day result should be in one column Cell No. AP9.

Thanks,
 

Attachments

  • sheet.png
    sheet.png
    15.3 KB · Views: 7
Upvote 0
We can't see any column labels or row numbers in that so your description cannot easily be related to the image. Further, we cannot copy paste from an image to test with.
 
Upvote 0
Hello,

I need a formula to subtract the two latest cells values based on the values in the cells of a particular day.
For example, I did my entries on Saturday in cells D9 and F9 I want to subtract these two values 1100 - 200 which will result in column AP9 1100-200 = 900
So next day I again on Sunday I insert values in I9 and K9 where I want subtraction but the result should be reflected in the same cell No. AP9
this is what I want for my whole week result should be calculated in AP9 and the logical purpose is to avoid inserting several columns for subtraction with each day.
Just want the current day result should be in one column Cell No. AP9.

Thanks,
 
Upvote 0
Hello,

I need a formula to subtract the two latest cells values based on the values in the cells of a particular day.
For example, I did my entries on Saturday in cells D9 and F9 I want to subtract these two values 1100 - 200 which will result in column AP9 1100-200 = 900
So next day I again on Sunday I insert values in I9 and K9 where I want subtraction but the result should be reflected in the same cell No. AP9
this is what I want for my whole week result should be calculated in AP9 and the logical purpose is to avoid inserting several columns for subtraction with each day.
Just want the current day result should be in one column Cell No. AP9.

Thanks,
Workfront Tracker - R0.1 draft - Copy.xlsx
DEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQ
6SATURDAYSUNDAYMONDAYTUEWEDNESDAYTHURSDAYFRIFRONT TO BE MAINTAINEDACTUAL FRONT
7AVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PODUCTION
8QTY.UNITQTYUNITQTY.UNITQTYUNITQTY.UNITQTYUNITQTY.UNITQTYUNITQTY.UNITQTYUNITQTY.UNITQTYUNITQTY.UNITQTYUNITQTYUNITQTYUNIT
91100lm200lm1000lm210lm900lm160lm1000lm200lm850lm150lm900lm170lm1000lm200lm950lm900lm
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
WORKFRONT TRACKER
Cell Formulas
RangeFormula
AP9AP9=D9-F9
 
Upvote 0
Thanks for the XL2BB sample data. Is this the sort of thing you are after?

21 08 18.xlsm
DEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQ
6SATURDAYSUNDAYMONDAYTUEWEDNESDAYTHURSDAYFRIFRONT TO BE MAINTAINEDACTUAL FRONT
7AVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PODUCTION
8QTY.UNITQTYUNITQTY.UNITQTYUNITQTY.UNITQTYUNITQTY.UNITQTYUNITQTY.UNITQTYUNITQTY.UNITQTYUNITQTY.UNITQTYUNITQTYUNITQTYUNIT
91100lm200lm1000lm210lm900lm160lm740
Sheet2 (2)
Cell Formulas
RangeFormula
AP9AP9=LET(f,FILTER(D9:AK9,(D$8:AK$8="QTY.")*(D9:AK9<>"")),INDEX(f,COUNT(f))-LOOKUP(9^9,D9:AK9))
 
Upvote 0
Thanks for the XL2BB sample data. Is this the sort of thing you are after?

21 08 18.xlsm
DEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQ
6SATURDAYSUNDAYMONDAYTUEWEDNESDAYTHURSDAYFRIFRONT TO BE MAINTAINEDACTUAL FRONT
7AVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PRODUCTIONAVAILABLE FRONTDAILY PODUCTION
8QTY.UNITQTYUNITQTY.UNITQTYUNITQTY.UNITQTYUNITQTY.UNITQTYUNITQTY.UNITQTYUNITQTY.UNITQTYUNITQTY.UNITQTYUNITQTYUNITQTYUNIT
91100lm200lm1000lm210lm900lm160lm740
Sheet2 (2)
Cell Formulas
RangeFormula
AP9AP9=LET(f,FILTER(D9:AK9,(D$8:AK$8="QTY.")*(D9:AK9<>"")),INDEX(f,COUNT(f))-LOOKUP(9^9,D9:AK9))
I appreciate your help it works great. But I am facing one issue when I try this sheet on another PC then I was getting #NAME? error and when I check the formula it's changing the function to this =_xlfn.LET(_xlpm.f,FILTER(D9:AK9,(D$8:AK$8="QTY.")*(D9:AK9<>"")),INDEX(_xlpm.f,COUNT(_xlpm.f))-LOOKUP(9^9,D9:AK9)) I am using MS 365 Apps for enterprise but when I check on MS 365 ProPlus it was giving me this error and this sheet will be using many other users which may use a different version of excel 2013, 2016, etc.. so what is the solution for this can you guide me, please.

Thank you.
 
Upvote 0
Yes, that formula for MS 365 only. Try this one for Excel 2010 or later.

Excel Formula:
=INDEX(D9:AK9,AGGREGATE(14,6,(COLUMN(D9:AK9)-COLUMN(D9)+1)/((D$8:AK$8="QTY.")*(D9:AK9<>"")),1))-LOOKUP(9^9,D9:AK9)
 
Upvote 0
Solution

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top