LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default Help writing a formula

Hi, I dun really understand what is your end product but just give it a try
and maybe you can make something out of it. I assume that you have
information in cell 3 and 4. What you want to work at is cell 1 and 2.

Start from cell A1 =D1&"-"&TEXT(1,"#")
Cell B1 =A1&"-"&TEXT(1,"#")

In cell A2 and B2, it will be different from above.

In A2 =IF(C2=C1,+D2&"-"&TEXT(MID(A1,4,1),"#"),D2&"-"&TEXT(MID(A1,4,1),"#")+1)

In B2
=IF(MID(A2,4,1)=MID(A1,4,1),A1&"-"&TEXT(MID(B1,6,1),"#")+1,A2&"-"&TEXT(1,"#"))


Drag the formula in cell A2 and B2 down. Change the range as you require.

Let me know if it helps you.


"WA" wrote:

I have a huge database that I need to create numbering for each line like
this example: AK-233 (2 letter state, a dash, and 1-4 digit number), but the
number doesn't change each line - sometimes the number will be duplicated on
multiple lines because those lines have the same title, I also need to create
another cell extending that letter/number combo that will differentiate the
1st cell.
So the first cell stays the same if the title is the same. The second cell
adds another layer of numbering to differentiate the first cell.
See example:
(Row1, Col 1-4) AK-1, AK-1-1, Title1, AK
(Row2, Col 1-4) AK-1, AK-1-2, Title1, AK
(Row3, Col 1-4) AK-1, AK-1-3, Title1, AK
(Row4, Col 1-4) AK-2, AK-2-1, Title2, AK
(Row5, Col 1-4) AK-2, AK-2-2, Title2, AK
So - I have the Title and the State (2 letters) in different cells (cell 3 &
cell 4 in each row above). Now I need a formula for cell 1 and cell 2.
Cell 1: Copies the state letters from cell 4, adds a dash, adds a number
starting with 1. IF the title is the same as the one in the row above it -
the number does not change. IF the title is different than the one in the row
above it - than the number should add +1 to the previous number.
Cell 2: This copies cell 1 but adds +1 to the cell above it if it is the
same number.

I've really confused myself with how to do this - or explain it. Anyone out
there that may be willing to help get me started on this?
Thanks!
Wendy
--
WA

 
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
writing an IF/AND formula Jill_ Excel Worksheet Functions 1 October 15th 09 06:29 PM
Need help writing a formula phyllis Excel Worksheet Functions 13 June 4th 08 05:01 PM
help in writing a formula Soth Excel Worksheet Functions 4 February 2nd 07 12:22 AM
Need help writing formula plz.. nparrott Excel Discussion (Misc queries) 7 February 10th 06 05:26 PM
writing a formula wolfmasterr Excel Discussion (Misc queries) 3 May 23rd 05 02:27 PM


All times are GMT +1. The time now is 09:23 AM.

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"