How to subtract cell with the help of VLOOKUP or any other function/formula

GAURAV SEMWAL

New Member
Joined
Oct 19, 2022
Messages
30
Office Version
  1. 365
Platform
  1. Windows
how can I subtract current day data from previous day data with in a same month in complete worksheet, for example to get the value in cell N9 that is cell M9-P12 & cell N8 that is M8-M9, how can I get the value automatically

1667666291369.png
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
This is an example for your current scenario but you can configure this for your all sheet:
Excel Formula:
=M9-VLOOKUP($L9-1, $L:$P, 5, 0)

To make this more general:
Excel Formula:
=M9-VLOOKUP($L9-1, $L:$U, COLUMN(E1), 0)
So when you move to colum Q, the formula eventually become:
Excel Formula:
=Q9-VLOOKUP($L9-1, $L:$U, COLUMN(H1), 0)
 
Last edited by a moderator:
Upvote 0
This is an example for your current scenario but you can configure this for your all sheet:
Excel Formula:
=M9-VLOOKUP($L9-1, $L:$P, 5, 0)

To make this more general:
Excel Formula:
=M9-VLOOKUP($L9-1, $L:$U, COLUMN(E1), 0)
So when you move to colum Q, the formula eventually become:
Excel Formula:
=Q9-VLOOKUP($L9-1, $L:$U, COLUMN(H1), 0)[
[/QUOTE]
First of all thanx for the reply. Sir if i do l minus 1 then there  will be an error because like L8 has 31 October and L9 has 28 October then I want data by subtracting 28 from 31 but I am  getting error and how to solve it.
1667713001648.png
 
Upvote 0
Ohh.. You don't have 29 October. So maybe you should look for closest match. Oaste this to N9:
Excel Formula:
=M9-VLOOKUP($L9-1, $L:$U, COLUMN(E1), 1)
 
Upvote 0
Solution

Forum statistics

Threads
1,215,832
Messages
6,127,150
Members
449,366
Latest member
reidel

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