Cell value dependent on adjacent cell on financials

rcmii

Board Regular
Joined
Jul 17, 2008
Messages
98
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I have a financial spreadsheet of approximately 5000 rows. It has line(s) of costs with the parent entity at the bottom. A line skips and then it goes to the next line(s), etc.

What I want to do is have that parent entity to the right of the cost designations but then start anew when the next section comes up. I've wracked my brain and my Jelen book but I'm not getting what I want.

Any thoughts?

Screenshot.png

Below the "What I want" are new rows, maybe Franklin & C, maybe another company and with a varying amount of lines above it for the lines of financials.

If I only had a hundred rows, I could force it through and be done. However, looking to learn for long-term and also solve this much faster than a copy/paste back and forth mumbo jumbo for 5000+ rows of data.
 
Wait...you replied before I sent the last message....let me read yours first...
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
OK. So I can replicate that and it works. However, it seems that I have to adjust for each sub-section depending on the number of rows, rather than copy/paste all of the way down column C. Is that correct and there is not a reasonable way to combine to one formula (unless I do a VBA, which may be what you suggested the first time)?
 
Upvote 0
Book1
ABC
1 
21400220 RM request EGFranklin & Co
31400250 RM request EG without IDFranklin & Co
4Franklin & CoFranklin & Co
Sheet1
Cell Formulas
RangeFormula
C1:C4C1=IF(ISBLANK(A1),"",IF(ISNUMBER(MID(TRIM(A1),1,6)*1),C2,A1))

No need to adjust. just copy c1 and paste in c2 thru c6000. no need to change any formula
 
Upvote 0
Solution
That's fantastic! It works. I found a few lines, hundreds of rows into the sheet that there is actually wording above the lines that is just a header, but I'll figure out that as a one-off

Thank you so much!
 
Upvote 0
Glad we made it work and thx for your patience to work through the issues. in future use the xl2bb tool to paste your cells, instead of images, so that we can use it to test our suggestion before replying to you. it will take a long time for us to recreate the data. also mark the post 13 as a solution instead of 14. thx.
 
Upvote 0
Here is an alternate means to the end. Power Query solution:
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type any}, {"Column3", type number}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Value.FromText(Text.Start([Column1],1))),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each try Number.From([Custom]) is number otherwise [Column1]),
    #"Replaced Value" = Table.ReplaceValue(#"Added Custom1",true,null,Replacer.ReplaceValue,{"Custom.1"}),
    #"Filled Up" = Table.FillUp(#"Replaced Value",{"Custom.1"}),
    #"Reordered Columns" = Table.ReorderColumns(#"Filled Up",{"Column1", "Custom.1", "Column2", "Column3", "Custom"}),
    #"Removed Columns" = Table.RemoveColumns(#"Reordered Columns",{"Column2", "Custom"})
in
    #"Removed Columns"

Book3
ABCDEFG
1Column1Column2Column3Column1Custom.1Column3
2660000 RM Stock of Work in Progress960252.03660000 RM Stock of Work in ProgressFranklin & Co960252.03
3665000 RM Stock of HF Assembly7718492.33665000 RM Stock of HF AssemblyFranklin & Co7718492.33
4665000 RM Stock of HF in Assembly0665000 RM Stock of HF in AssemblyFranklin & Co0
5Franklin & Co8678744.36Franklin & CoFranklin & Co8678744.36
6660000 RM Stock of Work in Progress660252.03660000 RM Stock of Work in ProgressJacks Co660252.03
7665000 RM Stock of HF Assembly718492.33665000 RM Stock of HF AssemblyJacks Co718492.33
8665000 RM Stock of HF in Assembly45665000 RM Stock of HF in AssemblyJacks Co45
9Jacks Co1378789.36Jacks CoJacks Co1378789.36
Sheet1
Cell Formulas
RangeFormula
C5,C9C5=SUM(C2:C4)
 
Upvote 0
Glad we made it work and thx for your patience to work through the issues. in future use the xl2bb tool to paste your cells, instead of images, so that we can use it to test our suggestion before replying to you. it will take a long time for us to recreate the data. also mark the post 13 as a solution instead of 14. thx.
Thanks again for your help yesterday. I'm embarrassed to ask this question, but what does the *1 do in the formula you've written?

=IF(ISBLANK(A1),"",IF(ISNUMBER(MID(TRIM(A1),1,6)*1),C2,A1))

I understand it's looking for and trimming a number in A1, if it's a number, starting at digit 1 and moving 6 spaces), and depending on the outcome, referencing C2 if true and A1 if not. But what does the *1 do exactly, other than multiplying the total by 1? Does that change/fix the data to be better "viewed" by the formula for calculation purposes?
 
Upvote 0
there is no need to be embarrassed. We all learn something every day. I missed the *1 in my earlier solution and that is why my previous solution did not work.
In most of the places when a number is required, excel converts "19" to number 19. But in ISNUMBER function excel does not do any type conversion.
ISNUMBER("19") will give false. to force it to do conversion to number, "19" * 1, it will convert text "19" to numerical 19.
Hope this helps.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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