Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
FireGeek822
 
Posts: n/a
Default Function or VBA Help Needed

I am trying to do some automation of cells and have an IF Function
started. As I continue to build this automation, I am wondering if a
VBA solution is better? Any help/suggestions would be appreciated.

Current function in all ColB cells starting at row B2 (B1 is empty on
purpose) is as follows:

=IF((A2)<"", CONCATENATE((A2), ".", "1"), CONCATENATE((A2), ".",
(RIGHT((B2), (SEARCH(".",(B2),1))-1))+1))

This produces the following

ColA ColB
1
1.1
1.2
1.3
2 1.4
2.1
2.2
2.3
3 2.4
3.1
3.2
3.3
4 3.4
4.1

Ideally, we want all cells that now contain 1.4, 2.4, 3.4, etc to be
blank as with cell (B1). We would like ColB to be locked so no one can
edit this column. It should also update automatically if someone enters
a value in ColA.

Any thoughts/suggestions would be greatly appreciated.

Tammy


  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default Function or VBA Help Needed

One way:

B1: <blank
B2: =IF(A2,"",MAX($A$1:A1)&"."&IF(B1="",1,MID(B1,FIND( ".",B1)+1,15)+1))

Copy B2 down as far as necessary.



In article .com,
"FireGeek822" wrote:

I am trying to do some automation of cells and have an IF Function
started. As I continue to build this automation, I am wondering if a
VBA solution is better? Any help/suggestions would be appreciated.

Current function in all ColB cells starting at row B2 (B1 is empty on
purpose) is as follows:

=IF((A2)<"", CONCATENATE((A2), ".", "1"), CONCATENATE((A2), ".",
(RIGHT((B2), (SEARCH(".",(B2),1))-1))+1))

This produces the following

ColA ColB
1
1.1
1.2
1.3
2 1.4
2.1
2.2
2.3
3 2.4
3.1
3.2
3.3
4 3.4
4.1

Ideally, we want all cells that now contain 1.4, 2.4, 3.4, etc to be
blank as with cell (B1). We would like ColB to be locked so no one can
edit this column. It should also update automatically if someone enters
a value in ColA.

Any thoughts/suggestions would be greatly appreciated.

Tammy

  #3   Report Post  
FireGeek822
 
Posts: n/a
Default Function or VBA Help Needed

Thanks for the help. Not sure what is going on in your formula and
would like to understand it if you could explain. Typically, I like to
understand what I am building vs. just using someone's code.

Tammy


  #4   Report Post  
JE McGimpsey
 
Posts: n/a
Default Function or VBA Help Needed

Breaking it down:

B2: =IF(A2,"",MAX($A$1:A1)&"."&IF(B1="",1,MID(B1,FIND( ".",B1)+1,15)+1))


=IF(A2,""

if A2 is blank (or zero), then B2 will be blank. Otherwise

MAX($A$1:A1)

returns the largest value in column A up to the previous row. This
assumes that your numbers in column A are in ascending order, which
seems likely given your example.

&"."

append a decimal point.

&IF(B1="",1

If the cell above is blank (because the column A cell holds a value),
then append 1 to start the sequence, otherwise

MID(B1,FIND(".",B1)+1, 15)+1

Find the value to the right of the decimal point in the previous cell,
add 1, and append it to the "x."



In article . com,
"FireGeek822" wrote:

Thanks for the help. Not sure what is going on in your formula and
would like to understand it if you could explain. Typically, I like to
understand what I am building vs. just using someone's code.

Tammy

  #5   Report Post  
FireGeek822
 
Posts: n/a
Default Function or VBA Help Needed

Thanks for such a thorough explanation. I should have been more clear
- wasn't sure about the MAX portion of your statement.

THANKS anyway - for the newbies out there looking at this post.

Tammy



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DAverage Function help needed xrayr Excel Worksheet Functions 3 July 26th 05 04:09 PM
Desperate Help needed with a function. Lori Excel Worksheet Functions 3 July 21st 05 03:19 AM
function needed David Harrison Excel Worksheet Functions 1 February 23rd 05 11:28 PM
IF function help needed jmcclain Excel Worksheet Functions 2 February 23rd 05 04:33 PM
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. Robert AS Excel Worksheet Functions 4 December 2nd 04 10:49 AM


All times are GMT +1. The time now is 11:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"