INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Off-topic: Expression Help in Excel  (Read 6348 times)

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1356
Off-topic: Expression Help in Excel
« on: January 30, 2013, 12:48:58 am »

I'm trying to use excel to build a handover sheet for the special care nursery I work in.

Quick question to anyone who might know...

If I have a cell containing gestational age in the format 32+5
  is there any way to extract the '32' and the '5' as two separate things for reference in other cells? I'd like to do this without needing two separate cells.

For a bit of background, I'm trying to have excel automatically calculate the age of the baby in days and the corrected gestational age (=age in days + gestational age)

Thanks in advance.
Logged

mykillk

  • Regular Member
  • World Citizen
  • ***
  • Posts: 236
Re: Off-topic: Expression Help in Excel
« Reply #1 on: January 30, 2013, 01:08:05 am »

LEFT( CELL, 2 ) <--- grab that 32
RIGHT( CELL, 1 ) <---- grab that 5

The 2 and 1 being the number of characters/digits you want to grab. So it would only work if your numbers will have the same number of digits. If not, use zero padding.
Logged

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1356
Re: Off-topic: Expression Help in Excel
« Reply #2 on: January 30, 2013, 02:03:21 am »

Excellent. Works perfectly - thanks mykillk!
Logged

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1356
Re: Off-topic: Expression Help in Excel
« Reply #3 on: January 30, 2013, 06:40:47 am »

New question - how can I pick the '2' in q2h?
q1h = 1
q2h = 2
q3h = 3 etc?

Thanks again!
Logged

fridden

  • Recent member
  • *
  • Posts: 31
Re: Off-topic: Expression Help in Excel
« Reply #4 on: January 30, 2013, 09:08:14 am »

New question - how can I pick the '2' in q2h?


if the number is always in the 2nd position you can use =MID(cell,character-posotion,length)

So if q1h is in A1 you can say
=MID(A1,2,1)

/fridden
Logged
Pages: [1]   Go Up