Formula that look upwards cell if reference cell is blank ( Empty ) till the value is found and calculate percentage based on that value.

Amit Desai

New Member
Joined
Mar 21, 2020
Messages
16
Office Version
  1. 2013
Platform
  1. Windows
Material CodeMATERIAL DISCRIPSIONUOM%Part WeghtOPENING
STOCK
Material IssueOK
Count
REJ.Total
SFG Qty
TOTAL
CONSUMPTION
Formula SampleR/M%actual Result should be
4214211725​
acg
87.50%​
1593​
220​
200​
2540
254​
404.622​
=K2*D2
354.04​
=K2*D2
1199000002​
abg
12.50%​
1593​
0​
0​
0=K2*D3
50.58​
=K2*D3 ( as the K3 cell is empty it needs to lookup ward till the value found and multiply % based on found value.
4214210231​
adg
88.50%​
960​
355​
0​
1876
193​
185.28​
=K4*D4
163.96​
4214210380​
aag
1.50%​
960​
0​
0​
0=K4*D5
2.78​
1199000052​
arg
10.00%​
960​
0​
0​
0=K4*D6
18.53​
1312000156​
apNos
0.01%​
960​
0​
0​
0=K4*D7
0.01​
4214210239​
aog
85.00%​
216​
70​
250​
10426
1048​
226.368​
=K8*D8
192.41​
1199000321​
amg
15.00%​
216​
0​
0​
0=K8*D9
33.96​
4214210249​
ang
36.20%​
63​
0​
0​
145612
1468​
92.484​
=K10*D10
33.48​
4214210260​
abg
55.80%​
63​
0​
0​
0=K8*D11
126.31​
4214210261​
afg
2.00%​
63​
0​
0​
0=K8*D12
4.53​
4214211516​
ajg
6.00%​
63​
0​
0​
0=K8*D13
13.58​


hope above table help you to understand the requirement .
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
How about
Excel Formula:
=LOOKUP(2,1/(K$2:K2<>""),K$2:K2)*D2
 
Upvote 0
Because your col K values are numeric, you should also be able to use this.
Excel Formula:
=LOOKUP(9^9,K$2:K2)*D2
 
Upvote 0
Namaste From India 🙏,

@Fluff you are magician... your formula worked perfectly as needed. Thanks a Lot.....👍
@Peter_SSs , Thanks for your attempt, but in your formula give different result then what i was expectation. Thanks a lot.

Lots of love to both of you for your valuable time and helping nature.🫶

Take Care.
 
Upvote 0
@Peter_SSs , Thanks for your attempt, but in your formula give different result then what i was expectation.
Hmm, I wonder what then is different between the sample data that you posted and what you are actually using the formulas with?
Here are the two formulas with the sample data you posted. Identical results.

24 03 19.xlsm
DKMN
1%TOTAL CONSUMPTIONPost #2Post #3
287.50%404.622354.04425354.04425
312.50%50.5777550.57775
488.50%185.28163.9728163.9728
51.50%2.77922.7792
610.00%18.52818.528
70.01%0.0185280.018528
885.00%226.368192.4128192.4128
915.00%33.955233.9552
1036.20%92.48433.47920833.479208
1155.80%51.60607251.606072
122.00%1.849681.84968
136.00%5.549045.54904
Amit Desai
Cell Formulas
RangeFormula
M2:M13M2=LOOKUP(2,1/(K$2:K2<>""),K$2:K2)*D2
N2:N13N2=LOOKUP(9^9,K$2:K2)*D2
 
Upvote 0
Hi @Peter_SSs

Apology for very late reply. I don't know what was the issue but when i have used your formula it was calculating result based on 1st cell value which is 404.662 for all trailing cell.

Thanks again for your valuable time. Take Care...... 🙏

Regards,
Amit Desai.
 
Upvote 0
I don't know what was the issue but when i have used your formula it was calculating result based on 1st cell value which is 404.662 for all trailing cell.
It doesn't really matter as you have a working solution but perhaps you accidentally included an extra $ sign in my formula as that would cause those results.

=LOOKUP(9^9,K$2:K$2)*D2

Cell Formulas
RangeFormula
M2:M13M2=LOOKUP(2,1/(K$2:K2<>""),K$2:K2)*D2
N2:N13N2=LOOKUP(9^9,K$2:K2)*D2
O2:O13O2=LOOKUP(9^9,K$2:K$2)*D2
 
Upvote 0
Solution
It doesn't really matter as you have a working solution but perhaps you accidentally included an extra $ sign in my formula as that would cause those results.

=LOOKUP(9^9,K$2:K$2)*D2
Hi @Peter_SSs ,

You are right i have made mistake during edit the column address. i have reapply the formula and it worked same as you have mentioned.

My sincere apology and thanks a lot for your kind help and time. :)

Is there any book or course which taught such complicated formulas? or it required knowledge of coding to get in-depth knowledge of excel formulas? As an end user we hardly apply 20 to 30 ( or less then that ) types of formulas .

Regards,
Amit Desai.
 
Upvote 0
Glad we were at least able to work out what had happened. (y)

Is there any book or course which taught such complicated formulas? or it required knowledge of coding to get in-depth knowledge of excel formulas? As an end user we hardly apply 20 to 30 ( or less then that ) types of formulas .
A large proportion of what I know I learned here in the forum & a lot of trial-and-error, not books or courses. :biggrin:
 
Upvote 0
Please mark the post as the solution that best actually answered your question. If no post answered your question then it is fine to not mark any post. I have removed the solution mark from post 9 as it certainly is not a solution to the thread question. :)
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,117
Members
453,021
Latest member
Justyna P

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