formula

abbyabby

New Member
Joined
May 28, 2023
Messages
16
Office Version
  1. 365
Hello. I am trying to find a formula that looks at a column of figures with intermittent blank cells that can return the value of the cell above the blank cell. This formula gives me the oldest charged price for a customer

=IF(D2="",D3,"")

But I also need to be able to pull the value in the last cell before the blank cell that divides each customer's stats up occurs in each column

The annual sales are calculated using this formula which adjusts itself as it goes down the column, something like that but only getting the last blank cell's value?
=IF(F2="",SUM(F2:INDEX(F2:$F$74,MATCH(TRUE,(F3:$F$74=""),0))),"")
 

Attachments

  • sample.jpg
    sample.jpg
    128.1 KB · Views: 11
Last edited by a moderator:

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Can you post some sample data.

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
I have added the ad-in and it says it successfully copies the Mini Sheet to the clipboard but I can't paste it into this.
 
Upvote 0
sample.xlsx
ABCDEFGHI
1DateQuantityAnnual QuantityItem PriceDescriptionAmountOriginal Price2022 price riseAnnual Sales
2customer 1642$2.50needs to return last figure before blank cell in column F for customer 1$1,605.00
310/08/202240 $2.50product$100.00  
422/09/202230 $2.50product$75.00  
56/10/202237 $2.50product$92.50  
620/10/202220 $2.50product$50.00  
79/11/202235 $2.50product$87.50  
816/11/202250 $2.50product$125.00  
915/12/202237 $2.50product$92.50  
1027/12/202260 $2.50product$150.00  
115/01/202350 $2.50product$125.00  
1217/01/202345 $2.50product$112.50  
1331/01/202332 $2.50product$80.00  
1422/02/202335 $2.50product$87.50  
1516/03/202343 $2.50product$107.50  
166/04/202350 $2.50product$125.00  
1724/04/202331 $2.50product$77.50  
1830/05/202347 $2.50product$117.50  
19customer 2560$2.00needs to return last figure before blank cell in column F for customer 2$1,171.00
2011/08/202250 $2.00product$100.00  
2113/10/202245 $2.10product$94.50  
2211/11/202240 $2.10product$84.00  
239/12/202227 $2.10product$56.70  
2420/12/2022-1 $2.10product-$2.10  
2520/12/202245 $2.10product$94.50  
2623/12/202228 $2.10product$58.80  
276/01/202340 $2.10product$84.00  
2830/01/202340 $2.10product$84.00  
2917/02/202340 $2.10product$84.00  
3028/02/202358 $2.10product$121.80  
315/04/202360 $2.10product$126.00  
3224/05/202350 $2.10product$105.00  
3323/06/202338 $2.10product$79.80  
34customer 3897$2.00needs to return last figure before blank cell in column F for customer 3$1,873.70
3528/09/2022100 $2.00product$200.00  
369/11/2022105 $2.10product$220.50  
376/12/202260 $2.10product$126.00  
3816/12/2022-20 $2.10product-$42.00  
3916/12/2022120 $2.10product$252.00  
4023/12/202230 $2.10product$63.00  
4129/12/2022100 $2.10product$210.00  
424/01/2023100 $2.10product$210.00  
4319/01/202360 $2.10product$126.00  
4423/02/2023100 $2.10product$210.00  
4521/03/202362 $2.10product$130.20  
463/04/202320 $2.10product$42.00  
4719/04/202360 $2.10product$126.00  
48customer 41025$2.00$2,138.50
Sheet3
Cell Formulas
RangeFormula
C2:C48C2=IF(B2="",SUM(B2:INDEX(B2:$B$74,MATCH(TRUE,(B3:$B$74=""),0))),"")
G2:G48G2=IF(D2="",D3,"")
I2:I48I2=IF(F2="",SUM(F2:INDEX(F2:$F$74,MATCH(TRUE,(F3:$F$74=""),0))),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
needs to return last figure before blank cell in column F for customer ...

Is this what you mean then?

23 08 10.xlsm
FGH
1AmountOriginal Price2022 price rise
22.5117.5
3100  
475  
592.5  
650  
787.5  
8125  
992.5  
10150  
11125  
12112.5  
1380  
1487.5  
15107.5  
16125  
1777.5  
18117.5  
19279.8
20100  
2194.5  
2284  
2356.7  
24-2.1  
2594.5  
2658.8  
2784  
2884  
2984  
30121.8  
31126  
32105  
3379.8  
342126
35200  
36220.5  
37126  
38-42  
39252  
4063  
41210  
42210  
43126  
44210  
45130.2  
4642  
47126  
Lookup
Cell Formulas
RangeFormula
G2:G47G2=IF(D2="",D3,"")
H2:H47H2=IF(G2="","",XLOOKUP("?",G3:G$100&"",F2:F$99,,2))
 
Upvote 0
Not exactly. I

Mine just returns #NAME? when I paste that in. What am I doing wrong??
 
Last edited by a moderator:
Upvote 0
Actully, since installing the X2bb add-in everything is returned #NAMe or #VALUE/!
 
Upvote 0
Not sure why you quoted your own post 5 (twice)? I have removed those quotes.

Mine just returns #NAME? when I paste that in. What am I doing wrong??
#NAME? means that you have used a function that does not exists in your Excel version. Your profile says Office 365 and if you do have that version you should have XLOOKUP as used in my suggestion.

Actully, since installing the X2bb add-in everything is returned #NAMe or #VALUE/!
XL2BB should not cause that behaviour and with the many hundreds of users who have installed XL2BB & used I don't believe anybody has reported such an outcome. If that is still happening it might be that your Excel version has gone wrong and you may need to do a repair or Reinstall.
 
Upvote 0
Not sure why you quoted your own post 5 (twice)? I have removed those quotes.


#NAME? means that you have used a function that does not exists in your Excel version. Your profile says Office 365 and if you do have that version you should have XLOOKUP as used in my suggestion.


XL2BB should not cause that behaviour and with the many hundreds of users who have installed XL2BB & used I don't believe anybody has reported such an outcome. If that is still happening it might be that your Excel version has gone wrong and you may need to do a repair or Reinstall.
I did a repair and also checked my Trust Centre settings but nothing worked. I ended up doing ctrl + shift + enter and it brought the answers back, but if I go into the cell to edit it I have to ctrl + shift + enter again to get it to work again.
 
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,963
Members
449,094
Latest member
Anshu121

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