newbieexcel24
New Member
- Joined
- Mar 14, 2024
- Messages
- 7
- Office Version
- 365
- Platform
- Windows
Hello all I'm trying to have my spreadsheet automatically convert units:
=IF(ISBLANK(D8),"",IF(ISBLANK(E8),IF(RIGHT(D8,2)="ml",VALUE(LEFT(D8,LEN(D8)-2)),IF(RIGHT(D8,1)="L",VALUE(LEFT(D8,LEN(D8)-1))*1000,IF(RIGHT(D8,2)="kg",VALUE(LEFT(D8,LEN(D8)-2))*1000,IF(RIGHT(D8,1)="g",VALUE(LEFT(D8,LEN(D8)-1)),D8)))),E8*IF(RIGHT(D8,2)="ml",VALUE(LEFT(D8,LEN(D8)-2)),IF(RIGHT(D8,1)="L",VALUE(LEFT(D8,LEN(D8)-1))*1000,IF(RIGHT(D8,2)="kg",VALUE(LEFT(D8,LEN(D8)-2))*1000,IF(RIGHT(D8,1)="g",VALUE(LEFT(D8,LEN(D8)-1)),D8))))))
where E8 is the number of containers.
=IF(ISBLANK(D10),"",IF(ISBLANK(E10),IF(RIGHT(D10,2)="mg",VALUE(LEFT(D10,LEN(D10)-2))/1000),E10*IF(RIGHT(D10,2)="mg",VALUE(LEFT(D10,LEN(D10)-2))/1000)))
However the first formula doesn't work when I try to incorporate the mg conversion, it gives a value error- I think it's to do with the fact I've already have ml conversion as it had worked when I replaced the ml conversion with the mg conversion, they just don't seem to work side by side?
Thanks in advance!
=IF(ISBLANK(D8),"",IF(ISBLANK(E8),IF(RIGHT(D8,2)="ml",VALUE(LEFT(D8,LEN(D8)-2)),IF(RIGHT(D8,1)="L",VALUE(LEFT(D8,LEN(D8)-1))*1000,IF(RIGHT(D8,2)="kg",VALUE(LEFT(D8,LEN(D8)-2))*1000,IF(RIGHT(D8,1)="g",VALUE(LEFT(D8,LEN(D8)-1)),D8)))),E8*IF(RIGHT(D8,2)="ml",VALUE(LEFT(D8,LEN(D8)-2)),IF(RIGHT(D8,1)="L",VALUE(LEFT(D8,LEN(D8)-1))*1000,IF(RIGHT(D8,2)="kg",VALUE(LEFT(D8,LEN(D8)-2))*1000,IF(RIGHT(D8,1)="g",VALUE(LEFT(D8,LEN(D8)-1)),D8))))))
where E8 is the number of containers.
=IF(ISBLANK(D10),"",IF(ISBLANK(E10),IF(RIGHT(D10,2)="mg",VALUE(LEFT(D10,LEN(D10)-2))/1000),E10*IF(RIGHT(D10,2)="mg",VALUE(LEFT(D10,LEN(D10)-2))/1000)))
However the first formula doesn't work when I try to incorporate the mg conversion, it gives a value error- I think it's to do with the fact I've already have ml conversion as it had worked when I replaced the ml conversion with the mg conversion, they just don't seem to work side by side?
Thanks in advance!