A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Adding a value to a customer ID?



 
 
Thread Tools Display Modes
  #1  
Old April 14th, 2010, 04:55 PM posted to microsoft.public.excel.worksheet.functions
Anne
external usenet poster
 
Posts: 445
Default Adding a value to a customer ID?

Hello!
I have a case number for a patient. 2009-001, for example, in C2.
I also have a contact number for the patient's family member, in D2.
How can I combine the patient's case number 2009-001 from C2 with an entry
in D2, 2009-001-01for each contact?

Example:
Jane Doe is case number 2009-001. She has two children, Josh and Jolene.
Josh would be contact number 2009-001-01. Jolene would be contact number
2009-001-02.
Then we'd have another case number: Doctor Pepper, 2010-003.
She has three contacts: Coke, 2010-003-01, Sprite, 2010-003-02, and Jack
Daniels, 2010-003-03.

How can I add the "-01", "-02" and "-03" automatically?
Thanks
  #2  
Old April 14th, 2010, 06:44 PM posted to microsoft.public.excel.worksheet.functions
Bernard Liengme
external usenet poster
 
Posts: 516
Default Adding a value to a customer ID?

Not too clear how you data is arranged. This is what I used
FIRST LAST ID CONTACT ID for contact
Jane Doe 2009-001 Josh 2009-001-001
Jane Doe 2009-001 Jolene 2009-001-002
Dr Pepper 2009-003 Coke 2009-003-001
Dr Pepper 2009-003 Sprite 2009-003-002
Dr Pepper 2009-003 Fresca 2009-003-003

The formula in E2 next to Josh is
=C2&"-00"&COUNTIF(C:C,C2)-COUNTIF(C2:$C$1001,C2)+1
Just change the 1001 to some other value if you have more records.
This will work for up to 9 contacts
After that you will get something like 2009-004-0011 rather than the
required 2009-004-011
Could be fixed if needed (does the Old Women who-lived-in-a-shoe frequent
your clinic?)
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme


"Anne" wrote in message
...
Hello!
I have a case number for a patient. 2009-001, for example, in C2.
I also have a contact number for the patient's family member, in D2.
How can I combine the patient's case number 2009-001 from C2 with an entry
in D2, 2009-001-01for each contact?

Example:
Jane Doe is case number 2009-001. She has two children, Josh and Jolene.
Josh would be contact number 2009-001-01. Jolene would be contact number
2009-001-02.
Then we'd have another case number: Doctor Pepper, 2010-003.
She has three contacts: Coke, 2010-003-01, Sprite, 2010-003-02, and Jack
Daniels, 2010-003-03.

How can I add the "-01", "-02" and "-03" automatically?
Thanks


  #3  
Old April 14th, 2010, 08:47 PM posted to microsoft.public.excel.worksheet.functions
Anne
external usenet poster
 
Posts: 445
Default Adding a value to a customer ID?

Hopefully the Old Woman Who Lived in A Shoe will go to her primary care
doctor instead!! LOL

Thanks so very much, Bernard!!!!


"Bernard Liengme" wrote:

Not too clear how you data is arranged. This is what I used
FIRST LAST ID CONTACT ID for contact
Jane Doe 2009-001 Josh 2009-001-001
Jane Doe 2009-001 Jolene 2009-001-002
Dr Pepper 2009-003 Coke 2009-003-001
Dr Pepper 2009-003 Sprite 2009-003-002
Dr Pepper 2009-003 Fresca 2009-003-003

The formula in E2 next to Josh is
=C2&"-00"&COUNTIF(C:C,C2)-COUNTIF(C2:$C$1001,C2)+1
Just change the 1001 to some other value if you have more records.
This will work for up to 9 contacts
After that you will get something like 2009-004-0011 rather than the
required 2009-004-011
Could be fixed if needed (does the Old Women who-lived-in-a-shoe frequent
your clinic?)
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme


"Anne" wrote in message
...
Hello!
I have a case number for a patient. 2009-001, for example, in C2.
I also have a contact number for the patient's family member, in D2.
How can I combine the patient's case number 2009-001 from C2 with an entry
in D2, 2009-001-01for each contact?

Example:
Jane Doe is case number 2009-001. She has two children, Josh and Jolene.
Josh would be contact number 2009-001-01. Jolene would be contact number
2009-001-02.
Then we'd have another case number: Doctor Pepper, 2010-003.
She has three contacts: Coke, 2010-003-01, Sprite, 2010-003-02, and Jack
Daniels, 2010-003-03.

How can I add the "-01", "-02" and "-03" automatically?
Thanks


.

  #4  
Old April 14th, 2010, 09:00 PM posted to microsoft.public.excel.worksheet.functions
Duke Carey
external usenet poster
 
Posts: 1,027
Default Adding a value to a customer ID?

Bernard - maybe

=C2&"-"&text(COUNTIF(C:C,C2)-COUNTIF(C2:$C$1001,C2)+1,"000")


"Bernard Liengme" wrote:

Not too clear how you data is arranged. This is what I used
FIRST LAST ID CONTACT ID for contact
Jane Doe 2009-001 Josh 2009-001-001
Jane Doe 2009-001 Jolene 2009-001-002
Dr Pepper 2009-003 Coke 2009-003-001
Dr Pepper 2009-003 Sprite 2009-003-002
Dr Pepper 2009-003 Fresca 2009-003-003

The formula in E2 next to Josh is
=C2&"-00"&COUNTIF(C:C,C2)-COUNTIF(C2:$C$1001,C2)+1
Just change the 1001 to some other value if you have more records.
This will work for up to 9 contacts
After that you will get something like 2009-004-0011 rather than the
required 2009-004-011
Could be fixed if needed (does the Old Women who-lived-in-a-shoe frequent
your clinic?)
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme


"Anne" wrote in message
...
Hello!
I have a case number for a patient. 2009-001, for example, in C2.
I also have a contact number for the patient's family member, in D2.
How can I combine the patient's case number 2009-001 from C2 with an entry
in D2, 2009-001-01for each contact?

Example:
Jane Doe is case number 2009-001. She has two children, Josh and Jolene.
Josh would be contact number 2009-001-01. Jolene would be contact number
2009-001-02.
Then we'd have another case number: Doctor Pepper, 2010-003.
She has three contacts: Coke, 2010-003-01, Sprite, 2010-003-02, and Jack
Daniels, 2010-003-03.

How can I add the "-01", "-02" and "-03" automatically?
Thanks


.

  #5  
Old April 15th, 2010, 01:43 PM posted to microsoft.public.excel.worksheet.functions
Bernard Liengme
external usenet poster
 
Posts: 516
Default Adding a value to a customer ID?

Thanks Duke - for some reason my brain seldom thinks about TEXT
best wishes
Bernard

"Duke Carey" wrote in message
...
Bernard - maybe

=C2&"-"&text(COUNTIF(C:C,C2)-COUNTIF(C2:$C$1001,C2)+1,"000")


"Bernard Liengme" wrote:

Not too clear how you data is arranged. This is what I used
FIRST LAST ID CONTACT ID for contact
Jane Doe 2009-001 Josh 2009-001-001
Jane Doe 2009-001 Jolene 2009-001-002
Dr Pepper 2009-003 Coke 2009-003-001
Dr Pepper 2009-003 Sprite 2009-003-002
Dr Pepper 2009-003 Fresca 2009-003-003

The formula in E2 next to Josh is
=C2&"-00"&COUNTIF(C:C,C2)-COUNTIF(C2:$C$1001,C2)+1
Just change the 1001 to some other value if you have more records.
This will work for up to 9 contacts
After that you will get something like 2009-004-0011 rather than the
required 2009-004-011
Could be fixed if needed (does the Old Women who-lived-in-a-shoe frequent
your clinic?)
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme


"Anne" wrote in message
...
Hello!
I have a case number for a patient. 2009-001, for example, in C2.
I also have a contact number for the patient's family member, in D2.
How can I combine the patient's case number 2009-001 from C2 with an
entry
in D2, 2009-001-01for each contact?

Example:
Jane Doe is case number 2009-001. She has two children, Josh and
Jolene.
Josh would be contact number 2009-001-01. Jolene would be contact
number
2009-001-02.
Then we'd have another case number: Doctor Pepper, 2010-003.
She has three contacts: Coke, 2010-003-01, Sprite, 2010-003-02, and
Jack
Daniels, 2010-003-03.

How can I add the "-01", "-02" and "-03" automatically?
Thanks


.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:37 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.